Class: Transit
- Defined in:
- lib/gatekeeper_api_client/resources/transit.rb
Instance Method Summary collapse
-
#initialize(record, on_error: ErrorHandler) ⇒ Transit
constructor
A new instance of Transit.
- #to_json ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(record, on_error: ErrorHandler) ⇒ Transit
Returns a new instance of Transit.
2 3 4 |
# File 'lib/gatekeeper_api_client/resources/transit.rb', line 2 def initialize(record, on_error: ErrorHandler) super(record, on_error: on_error) end |
Instance Method Details
#to_json ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/gatekeeper_api_client/resources/transit.rb', line 6 def to_json {"transit": { "occurred_at": UtcTime.parse(@record.date, @record.time), "badge_number": @record.badge_number, "sensor_code": @record.sensor_code, "authorized": @record. == "1" } } end |