Class: CTA::BusTracker::DirectionsResponse
- Inherits:
-
API::Response
- Object
- API::Response
- CTA::BusTracker::DirectionsResponse
- Defined in:
- lib/cta_redux/api/bus_tracker.rb
Instance Attribute Summary collapse
-
#directions ⇒ Array<Direction>
readonly
An array of Direction that the requested route operates.
Attributes inherited from API::Response
#error, #parsed_body, #raw_body, #timestamp
Instance Method Summary collapse
-
#initialize(parsed_body, raw_body, debug) ⇒ DirectionsResponse
constructor
A new instance of DirectionsResponse.
Constructor Details
#initialize(parsed_body, raw_body, debug) ⇒ DirectionsResponse
Returns a new instance of DirectionsResponse.
54 55 56 57 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 54 def initialize(parsed_body, raw_body, debug) super(parsed_body, raw_body, debug) @directions = Array.wrap(parsed_body["bustime_response"]["dir"]).map { |d| Direction.new(d) } end |
Instance Attribute Details
#directions ⇒ Array<Direction> (readonly)
Returns An array of CTA::BusTracker::Direction that the requested route operates.
52 53 54 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 52 def directions @directions end |