Class: Metromobilite::Model::Time
- Inherits:
-
Object
- Object
- Metromobilite::Model::Time
- Defined in:
- lib/metromobilite/model/time.rb
Instance Attribute Summary collapse
-
#arrivalDelay ⇒ Object
readonly
Returns the value of attribute arrivalDelay.
-
#departureDelay ⇒ Object
readonly
Returns the value of attribute departureDelay.
-
#realtime ⇒ Object
readonly
Returns the value of attribute realtime.
-
#realtimeArrival ⇒ Object
readonly
Returns the value of attribute realtimeArrival.
-
#realtimeDeparture ⇒ Object
readonly
Returns the value of attribute realtimeDeparture.
-
#scheduledArrival ⇒ Object
readonly
Returns the value of attribute scheduledArrival.
-
#scheduledDeparture ⇒ Object
readonly
Returns the value of attribute scheduledDeparture.
-
#serviceDay ⇒ Object
readonly
Returns the value of attribute serviceDay.
-
#stopId ⇒ Object
readonly
Returns the value of attribute stopId.
-
#stopName ⇒ Object
readonly
Returns the value of attribute stopName.
-
#timepoint ⇒ Object
readonly
Returns the value of attribute timepoint.
-
#tripId ⇒ Object
readonly
Returns the value of attribute tripId.
Instance Method Summary collapse
-
#initialize(jsonData) ⇒ Time
constructor
Instantiates a new Time object from received JSON data :call-seq: Time.new(jsonObj).
- #to_json(opts = nil) ⇒ Object
Constructor Details
#initialize(jsonData) ⇒ Time
Instantiates a new Time object from received JSON data :call-seq:
Time.new(jsonObj)
jsonData_Hash
-
The Time JSON hash object received from the API
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/metromobilite/model/time.rb', line 14 def initialize(jsonData) @stopId = jsonData['stopId'] @stopName = jsonData['stopName'] @scheduledArrival = jsonData['scheduledArrival'] @scheduledDeparture = jsonData['scheduledDeparture'] @realtimeArrival = jsonData['realtimeArrival'] @realtimeDeparture = jsonData['realtimeDeparture'] @arrivalDelay = jsonData['arrivalDelay'] @departureDelay = jsonData['departureDelay'] @timepoint = jsonData['timepoint'] @realtime = jsonData['realtime'] @serviceDay = jsonData['serviceDay'] @tripId = jsonData['tripId'] end |
Instance Attribute Details
#arrivalDelay ⇒ Object (readonly)
Returns the value of attribute arrivalDelay.
35 36 37 |
# File 'lib/metromobilite/model/time.rb', line 35 def arrivalDelay @arrivalDelay end |
#departureDelay ⇒ Object (readonly)
Returns the value of attribute departureDelay.
36 37 38 |
# File 'lib/metromobilite/model/time.rb', line 36 def departureDelay @departureDelay end |
#realtime ⇒ Object (readonly)
Returns the value of attribute realtime.
38 39 40 |
# File 'lib/metromobilite/model/time.rb', line 38 def realtime @realtime end |
#realtimeArrival ⇒ Object (readonly)
Returns the value of attribute realtimeArrival.
33 34 35 |
# File 'lib/metromobilite/model/time.rb', line 33 def realtimeArrival @realtimeArrival end |
#realtimeDeparture ⇒ Object (readonly)
Returns the value of attribute realtimeDeparture.
34 35 36 |
# File 'lib/metromobilite/model/time.rb', line 34 def realtimeDeparture @realtimeDeparture end |
#scheduledArrival ⇒ Object (readonly)
Returns the value of attribute scheduledArrival.
31 32 33 |
# File 'lib/metromobilite/model/time.rb', line 31 def scheduledArrival @scheduledArrival end |
#scheduledDeparture ⇒ Object (readonly)
Returns the value of attribute scheduledDeparture.
32 33 34 |
# File 'lib/metromobilite/model/time.rb', line 32 def scheduledDeparture @scheduledDeparture end |
#serviceDay ⇒ Object (readonly)
Returns the value of attribute serviceDay.
39 40 41 |
# File 'lib/metromobilite/model/time.rb', line 39 def serviceDay @serviceDay end |
#stopId ⇒ Object (readonly)
Returns the value of attribute stopId.
29 30 31 |
# File 'lib/metromobilite/model/time.rb', line 29 def stopId @stopId end |
#stopName ⇒ Object (readonly)
Returns the value of attribute stopName.
30 31 32 |
# File 'lib/metromobilite/model/time.rb', line 30 def stopName @stopName end |
#timepoint ⇒ Object (readonly)
Returns the value of attribute timepoint.
37 38 39 |
# File 'lib/metromobilite/model/time.rb', line 37 def timepoint @timepoint end |
#tripId ⇒ Object (readonly)
Returns the value of attribute tripId.
40 41 42 |
# File 'lib/metromobilite/model/time.rb', line 40 def tripId @tripId end |
Instance Method Details
#to_json(opts = nil) ⇒ Object
42 43 44 45 46 |
# File 'lib/metromobilite/model/time.rb', line 42 def to_json(opts = nil) hash = {} instance_variables.each {|var| hash[var.to_s.delete("@")] = instance_variable_get(var) } hash.to_json end |