Class: CTA::BusTracker::ServiceBulletinsResponse
- Inherits:
-
API::Response
- Object
- API::Response
- CTA::BusTracker::ServiceBulletinsResponse
- Defined in:
- lib/cta_redux/api/bus_tracker.rb
Instance Attribute Summary collapse
-
#bulletins ⇒ Array<ServiceBulletin>
readonly
An array of ServiceBulletin objects that correspond to the query requested.
Attributes inherited from API::Response
#error, #parsed_body, #raw_body, #timestamp
Instance Method Summary collapse
-
#initialize(parsed_body, raw_body, debug) ⇒ ServiceBulletinsResponse
constructor
A new instance of ServiceBulletinsResponse.
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
#bulletins ⇒ Array<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 |