Class: Bort::Realtime::Train
- Inherits:
-
Object
- Object
- Bort::Realtime::Train
- Defined in:
- lib/bort/realtime.rb
Instance Attribute Summary collapse
-
#bike_flag ⇒ Object
Returns the value of attribute bike_flag.
-
#color ⇒ Object
Returns the value of attribute color.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#hexcolor ⇒ Object
Returns the value of attribute hexcolor.
-
#length ⇒ Object
Returns the value of attribute length.
-
#minutes ⇒ Object
Returns the value of attribute minutes.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#station ⇒ Object
Returns the value of attribute station.
Instance Method Summary collapse
-
#initialize(doc, orig, dest) ⇒ Train
constructor
A new instance of Train.
Constructor Details
#initialize(doc, orig, dest) ⇒ Train
Returns a new instance of Train.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/bort/realtime.rb', line 66 def initialize(doc, orig, dest) self.station = orig self.destination = dest self.minutes = (doc/:minutes).inner_text.to_i self.platform = (doc/:platform).inner_text.to_i self.direction = (doc/:direction).inner_text[0,1].downcase self.length = (doc/:length).inner_text.to_i self.color = (doc/:color).inner_text.downcase self.hexcolor = (doc/:hexcolor).inner_text.downcase self.bike_flag = (doc/:bikeflag).inner_text == '1' end |
Instance Attribute Details
#bike_flag ⇒ Object
Returns the value of attribute bike_flag.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def bike_flag @bike_flag end |
#color ⇒ Object
Returns the value of attribute color.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def color @color end |
#destination ⇒ Object
Returns the value of attribute destination.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def destination @destination end |
#direction ⇒ Object
Returns the value of attribute direction.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def direction @direction end |
#hexcolor ⇒ Object
Returns the value of attribute hexcolor.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def hexcolor @hexcolor end |
#length ⇒ Object
Returns the value of attribute length.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def length @length end |
#minutes ⇒ Object
Returns the value of attribute minutes.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def minutes @minutes end |
#platform ⇒ Object
Returns the value of attribute platform.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def platform @platform end |
#station ⇒ Object
Returns the value of attribute station.
64 65 66 |
# File 'lib/bort/realtime.rb', line 64 def station @station end |