Class: Bort::Schedule::Stop

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#bike_flagObject

Returns the value of attribute bike_flag.



214
215
216
# File 'lib/bort/schedule.rb', line 214

def bike_flag
  @bike_flag
end

#origin_timeObject

Returns the value of attribute origin_time.



214
215
216
# File 'lib/bort/schedule.rb', line 214

def origin_time
  @origin_time
end

#stationObject

Returns the value of attribute station.



214
215
216
# File 'lib/bort/schedule.rb', line 214

def station
  @station
end

Class Method Details

.parse(doc, date) ⇒ Object



216
217
218
219
220
221
222
223
# File 'lib/bort/schedule.rb', line 216

def self.parse(doc, date)
  stop              = Stop.new
  stop.station      = doc.attributes['station']
  stop.origin_time  = Time.parse("#{date.to_s} #{doc.attributes['origtime']}")
  stop.bike_flag    = doc.attributes['bikeflag'] == '1'

  stop
end