Class: Transport::Stop
- Inherits:
-
Object
- Object
- Transport::Stop
- Defined in:
- lib/stop.rb
Instance Attribute Summary collapse
-
#arrival ⇒ Object
readonly
Returns the value of attribute arrival.
-
#delay ⇒ Object
readonly
Returns the value of attribute delay.
-
#departure ⇒ Object
readonly
Returns the value of attribute departure.
-
#realtimeAvailability ⇒ Object
readonly
Returns the value of attribute realtimeAvailability.
-
#station ⇒ Object
readonly
Returns the value of attribute station.
Instance Method Summary collapse
-
#initialize(stop) ⇒ Stop
constructor
A new instance of Stop.
Constructor Details
#initialize(stop) ⇒ Stop
Returns a new instance of Stop.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/stop.rb', line 9 def initialize(stop) return unless stop @station = Station.new stop['station'] @arrival = DateTime.parse stop['arrival'] if stop['arrival'] @departure = DateTime.parse stop['departure'] if stop['departure'] @delay = stop['delay'].to_i if stop['delay'] @platform = stop['platform'] if stop['platform'] @prognosis = Prognosis.new stop['prognosis'] @realtimeAvailability = stop['realtimeAvailability'] end |
Instance Attribute Details
#arrival ⇒ Object (readonly)
Returns the value of attribute arrival.
7 8 9 |
# File 'lib/stop.rb', line 7 def arrival @arrival end |
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
7 8 9 |
# File 'lib/stop.rb', line 7 def delay @delay end |
#departure ⇒ Object (readonly)
Returns the value of attribute departure.
7 8 9 |
# File 'lib/stop.rb', line 7 def departure @departure end |
#realtimeAvailability ⇒ Object (readonly)
Returns the value of attribute realtimeAvailability.
7 8 9 |
# File 'lib/stop.rb', line 7 def realtimeAvailability @realtimeAvailability end |
#station ⇒ Object (readonly)
Returns the value of attribute station.
7 8 9 |
# File 'lib/stop.rb', line 7 def station @station end |