Class: Bort::Schedule::TrainSchedule

Inherits:
Object
  • Object
show all
Defined in:
lib/bort/schedule.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#indexObject

Returns the value of attribute index.



202
203
204
# File 'lib/bort/schedule.rb', line 202

def index
  @index
end

#stopsObject

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