Class: Departure
- Inherits:
-
Object
- Object
- Departure
- Defined in:
- lib/model/departure.rb
Instance Attribute Summary collapse
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
-
#run ⇒ Object
readonly
Returns the value of attribute run.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(departure) ⇒ Departure
constructor
A new instance of Departure.
Constructor Details
#initialize(departure) ⇒ Departure
Returns a new instance of Departure.
8 9 10 11 12 |
# File 'lib/model/departure.rb', line 8 def initialize departure @platform = Platform.new(departure["platform"]) @run = Run.new(departure["run"]) @time = Time.parse(departure["time_timetable_utc"]) end |
Instance Attribute Details
#platform ⇒ Object (readonly)
Returns the value of attribute platform.
6 7 8 |
# File 'lib/model/departure.rb', line 6 def platform @platform end |
#run ⇒ Object (readonly)
Returns the value of attribute run.
6 7 8 |
# File 'lib/model/departure.rb', line 6 def run @run end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
6 7 8 |
# File 'lib/model/departure.rb', line 6 def time @time end |