Class: CTA::BusTracker::TimeResponse
- Inherits:
-
API::Response
- Object
- API::Response
- CTA::BusTracker::TimeResponse
- Defined in:
- lib/cta_redux/api/bus_tracker.rb
Instance Attribute Summary collapse
-
#timestamp ⇒ DateTime
readonly
Current time according to the BusTime servers which power the BusTracker API.
Attributes inherited from API::Response
#error, #parsed_body, #raw_body
Instance Method Summary collapse
-
#initialize(parsed_body, raw_body, debug) ⇒ TimeResponse
constructor
A new instance of TimeResponse.
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
#timestamp ⇒ DateTime (readonly)
Returns 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 end |