This method is doing too much. Can we extract into two methods - one to "get all the segments" and one to "get a particular segment"? Additionally, I would probably prefer to make `@segments` an `attr_reader` that is initialized in the initialize method, but that is a style thing.