Class: Transport::Stop
- Inherits:
-
Object
- Object
- Transport::Stop
- Defined in:
- lib/stop.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#station ⇒ Object
readonly
Returns the value of attribute station.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(stop) ⇒ Stop
constructor
A new instance of Stop.
Constructor Details
#initialize(stop) ⇒ Stop
Returns a new instance of Stop.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/stop.rb', line 9 def initialize(stop) return unless stop @station = Location.new stop['station'] @name = stop['name'] @category = stop['category'] @number = stop['number'] @operator = stop['operator'] @to = stop['to'] end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
7 8 9 |
# File 'lib/stop.rb', line 7 def category @category end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/stop.rb', line 7 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
7 8 9 |
# File 'lib/stop.rb', line 7 def number @number end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
7 8 9 |
# File 'lib/stop.rb', line 7 def operator @operator end |
#station ⇒ Object (readonly)
Returns the value of attribute station.
7 8 9 |
# File 'lib/stop.rb', line 7 def station @station end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
7 8 9 |
# File 'lib/stop.rb', line 7 def to @to end |