Class: Transport::Station
- Inherits:
-
Object
- Object
- Transport::Station
- Defined in:
- lib/station.rb
Instance Attribute Summary collapse
-
#coordinate ⇒ Object
readonly
Returns the value of attribute coordinate.
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(station) ⇒ Station
constructor
A new instance of Station.
Constructor Details
#initialize(station) ⇒ Station
Returns a new instance of Station.
11 12 13 14 15 16 17 18 |
# File 'lib/station.rb', line 11 def initialize(station) @id = station['id'] @name = station['name'] @score = station['score'] @coordinate = Coordinate.new station['coordinate'] @distance = station['distance'] @type = station['type'] end |
Instance Attribute Details
#coordinate ⇒ Object (readonly)
Returns the value of attribute coordinate.
9 10 11 |
# File 'lib/station.rb', line 9 def coordinate @coordinate end |
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
9 10 11 |
# File 'lib/station.rb', line 9 def distance @distance end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/station.rb', line 9 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/station.rb', line 9 def name @name end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
9 10 11 |
# File 'lib/station.rb', line 9 def score @score end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/station.rb', line 9 def type @type end |