Class: CTA::BusTracker::ServiceBulletin
- Inherits:
-
Object
- Object
- CTA::BusTracker::ServiceBulletin
- Defined in:
- lib/cta_redux/api/bus_tracker.rb
Instance Attribute Summary collapse
-
#affected_services ⇒ Array<Service>
readonly
An array of Service objects that encapsulate information (if any) about which routes and stops are affected by this bulletin.
-
#brief ⇒ String
readonly
Another short description of the bulletin.
-
#details ⇒ String
readonly
More details about the bulletin.
-
#name ⇒ String
readonly
The name of the bulletin.
-
#priority ⇒ Symbol
readonly
Priority of the alert.
-
#subject ⇒ String
readonly
A short description of the bulletin.
Instance Method Summary collapse
-
#initialize(sb) ⇒ ServiceBulletin
constructor
A new instance of ServiceBulletin.
Constructor Details
#initialize(sb) ⇒ ServiceBulletin
Returns a new instance of ServiceBulletin.
130 131 132 133 134 135 136 137 138 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 130 def initialize(sb) @name = sb["nm"] @subject = sb["sbj"] @details = sb["dtl"] @brief = sb["brf"] @priority = sb["prty"].downcase.to_sym @affected_services = Array.wrap(sb["srvc"]).map { |svc| Service.new(svc) } end |
Instance Attribute Details
#affected_services ⇒ Array<Service> (readonly)
Returns An array of CTA::BusTracker::Service objects that encapsulate information (if any) about which routes and stops are affected by this bulletin.
128 129 130 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 128 def affected_services @affected_services end |
#brief ⇒ String (readonly)
This seems to usually be unset by the CTA.
Returns Another short description of the bulletin.
124 125 126 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 124 def brief @brief end |
#details ⇒ String (readonly)
Returns More details about the bulletin.
121 122 123 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 121 def details @details end |
#name ⇒ String (readonly)
Returns The name of the bulletin.
117 118 119 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 117 def name @name end |
#priority ⇒ Symbol (readonly)
Returns Priority of the alert. One of [:low, :medium, :high].
126 127 128 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 126 def priority @priority end |
#subject ⇒ String (readonly)
Returns A short description of the bulletin.
119 120 121 |
# File 'lib/cta_redux/api/bus_tracker.rb', line 119 def subject @subject end |