Class: CTA::BusTracker::DirectionsResponse

Inherits:
API::Response show all
Defined in:
lib/cta_redux/api/bus_tracker.rb

Instance Attribute Summary collapse

Attributes inherited from API::Response

#error, #parsed_body, #raw_body, #timestamp

Instance Method Summary collapse

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

#directionsArray<Direction> (readonly)

Returns An array of CTA::BusTracker::Direction that the requested route operates.

Returns:



52
53
54
# File 'lib/cta_redux/api/bus_tracker.rb', line 52

def directions
  @directions
end