Class: CTA::BusTracker::TimeResponse

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

Instance Method Summary collapse

Constructor Details

#initialize(parsed_body, raw_body, debug) ⇒ TimeResponse

Returns a new instance of TimeResponse.



28
29
30
31
# File 'lib/cta_redux/api/bus_tracker.rb', line 28

def initialize(parsed_body, raw_body, debug)
  super(parsed_body, raw_body, debug)
  @timestamp = DateTime.parse(parsed_body["bustime_response"]["tm"])
end

Instance Attribute Details

#timestampDateTime (readonly)

Returns Current time according to the BusTime servers which power the BusTracker API.

Returns:

  • (DateTime)

    Current time according to the BusTime servers which power the BusTracker API



26
27
28
# File 'lib/cta_redux/api/bus_tracker.rb', line 26

def timestamp
  @timestamp
end