Class: CTA::BusTracker::ServiceBulletin

Inherits:
Object
  • Object
show all
Defined in:
lib/cta_redux/api/bus_tracker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_servicesArray<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.

Returns:



128
129
130
# File 'lib/cta_redux/api/bus_tracker.rb', line 128

def affected_services
  @affected_services
end

#briefString (readonly)

Note:

This seems to usually be unset by the CTA.

Returns Another short description of the bulletin.

Returns:

  • (String)

    Another short description of the bulletin



124
125
126
# File 'lib/cta_redux/api/bus_tracker.rb', line 124

def brief
  @brief
end

#detailsString (readonly)

Returns More details about the bulletin.

Returns:

  • (String)

    More details about the bulletin



121
122
123
# File 'lib/cta_redux/api/bus_tracker.rb', line 121

def details
  @details
end

#nameString (readonly)

Returns The name of the bulletin.

Returns:

  • (String)

    The name of the bulletin.



117
118
119
# File 'lib/cta_redux/api/bus_tracker.rb', line 117

def name
  @name
end

#prioritySymbol (readonly)

Returns Priority of the alert. One of [:low, :medium, :high].

Returns:

  • (Symbol)

    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

#subjectString (readonly)

Returns A short description of the bulletin.

Returns:

  • (String)

    A short description of the bulletin.



119
120
121
# File 'lib/cta_redux/api/bus_tracker.rb', line 119

def subject
  @subject
end