Class: CTA::BusTracker::ServiceBulletinsResponse

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) ⇒ ServiceBulletinsResponse



109
110
111
112
# File 'lib/cta_redux/api/bus_tracker.rb', line 109

def initialize(parsed_body, raw_body, debug)
  super(parsed_body, raw_body, debug)
  @bulletins = Array.wrap(parsed_body["bustime_response"]["sb"]).map { |sb| ServiceBulletin.new(sb) }
end

Instance Attribute Details

#bulletinsArray<ServiceBulletin> (readonly)

Note:

Consider using the CustomerAlerts methods to search for alerts, as theoretically they should have the same data and it is not a rate-limited API.

Returns An array of CTA::BusTracker::ServiceBulletin objects that correspond to the query requested.



107
108
109
# File 'lib/cta_redux/api/bus_tracker.rb', line 107

def bulletins
  @bulletins
end