Class: Transport::Coordinate
- Inherits:
-
Object
- Object
- Transport::Coordinate
- Defined in:
- lib/coordinate.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(coordinate) ⇒ Coordinate
constructor
A new instance of Coordinate.
Constructor Details
#initialize(coordinate) ⇒ Coordinate
Returns a new instance of Coordinate.
9 10 11 12 13 |
# File 'lib/coordinate.rb', line 9 def initialize(coordinate) @type = coordinate['type'].to_sym @x = coordinate['x'] @y = coordinate['y'] end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/coordinate.rb', line 7 def type @type end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
7 8 9 |
# File 'lib/coordinate.rb', line 7 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
7 8 9 |
# File 'lib/coordinate.rb', line 7 def y @y end |