Class: Bort::Schedule::StationLine
- Inherits:
-
Object
- Object
- Bort::Schedule::StationLine
- Defined in:
- lib/bort/schedule.rb
Overview
TODO: DRY with Leg?
Instance Attribute Summary collapse
-
#bike_flag ⇒ Object
Returns the value of attribute bike_flag.
-
#destination_time ⇒ Object
Returns the value of attribute destination_time.
-
#index ⇒ Object
Returns the value of attribute index.
-
#name ⇒ Object
Returns the value of attribute name.
-
#origin_time ⇒ Object
Returns the value of attribute origin_time.
-
#train_head_station ⇒ Object
Returns the value of attribute train_head_station.
Class Method Summary collapse
Instance Attribute Details
#bike_flag ⇒ Object
Returns the value of attribute bike_flag.
327 328 329 |
# File 'lib/bort/schedule.rb', line 327 def bike_flag @bike_flag end |
#destination_time ⇒ Object
Returns the value of attribute destination_time.
327 328 329 |
# File 'lib/bort/schedule.rb', line 327 def destination_time @destination_time end |
#index ⇒ Object
Returns the value of attribute index.
327 328 329 |
# File 'lib/bort/schedule.rb', line 327 def index @index end |
#name ⇒ Object
Returns the value of attribute name.
327 328 329 |
# File 'lib/bort/schedule.rb', line 327 def name @name end |
#origin_time ⇒ Object
Returns the value of attribute origin_time.
327 328 329 |
# File 'lib/bort/schedule.rb', line 327 def origin_time @origin_time end |
#train_head_station ⇒ Object
Returns the value of attribute train_head_station.
327 328 329 |
# File 'lib/bort/schedule.rb', line 327 def train_head_station @train_head_station end |
Class Method Details
.parse(doc, date) ⇒ Object
328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/bort/schedule.rb', line 328 def self.parse(doc, date) line = StationLine.new line.name = doc.attributes['line'] line.train_head_station = doc.attributes['trainheadstation'] line.origin_time = Time.parse("#{date} #{doc.attributes['origtime']}") line.destination_time = Time.parse("#{date} #{doc.attributes['desttime']}") line.index = doc.attributes['trainidx'].to_i line.bike_flag = doc.attributes['bikeflag'] == '1' line end |