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