Class: Bort::Schedule::TrainSchedule
- Inherits:
-
Object
- Object
- Bort::Schedule::TrainSchedule
- Defined in:
- lib/bort/schedule.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#stops ⇒ Object
Returns the value of attribute stops.
Class Method Summary collapse
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
202 203 204 |
# File 'lib/bort/schedule.rb', line 202 def index @index end |
#stops ⇒ Object
Returns the value of attribute stops.
202 203 204 |
# File 'lib/bort/schedule.rb', line 202 def stops @stops end |
Class Method Details
.parse(doc, date) ⇒ Object
204 205 206 207 208 209 210 |
# File 'lib/bort/schedule.rb', line 204 def self.parse(doc, date) schedule = TrainSchedule.new schedule.index = doc.attributes['index'].to_i schedule.stops = (doc/:stop).map{|stop| Stop.parse(stop, date)} schedule end |