Class: CTA::CustomerAlerts::RouteStatus

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(s) ⇒ RouteStatus

Returns a new instance of RouteStatus.



19
20
21
22
23
24
25
# File 'lib/cta_redux/api/customer_alerts.rb', line 19

def initialize(s)
  @route = CTA::Route.where(:route_id => s["Route"].split(" ").first).or(:route_id => s["ServiceId"]).first
  @route_color = s["RouteColorCode"]
  @route_text_color = s["RouteTextColor"]
  @status = s["RouteStatus"]
  @status_color = s["RouteStatusColor"]
end

Instance Attribute Details

#routeCTA::Route (readonly)

Returns The Route that corresponds to this CTA::CustomerAlerts::RouteStatus.

Returns:



9
10
11
# File 'lib/cta_redux/api/customer_alerts.rb', line 9

def route
  @route
end

#route_colorString (readonly)

Returns The color the CTA suggests when displaying information about this alert.

Returns:

  • (String)

    The color the CTA suggests when displaying information about this alert.



11
12
13
# File 'lib/cta_redux/api/customer_alerts.rb', line 11

def route_color
  @route_color
end

#route_text_colorString (readonly)

Returns The color of text the CTA suggests when displaying information about this alert.

Returns:

  • (String)

    The color of text the CTA suggests when displaying information about this alert.



13
14
15
# File 'lib/cta_redux/api/customer_alerts.rb', line 13

def route_text_color
  @route_text_color
end

#statusString (readonly)

Returns A text description of the status of this route.

Returns:

  • (String)

    A text description of the status of this route.



15
16
17
# File 'lib/cta_redux/api/customer_alerts.rb', line 15

def status
  @status
end

#status_colorString (readonly)

Returns A color suggestion from the CTA when displaying information about the route status.

Returns:

  • (String)

    A color suggestion from the CTA when displaying information about the route status.



17
18
19
# File 'lib/cta_redux/api/customer_alerts.rb', line 17

def status_color
  @status_color
end