Class: Hexagonly::Point
- Inherits:
-
Object
- Object
- Hexagonly::Point
- Includes:
- Methods
- Defined in:
- lib/hexagonly/point.rb
Defined Under Namespace
Modules: Methods
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(*coords) ⇒ Point
constructor
A new instance of Point.
Methods included from Methods
#<=>, included, #set_coords, #to_geojson, #x_coord, #x_coord=, #y_coord, #y_coord=
Constructor Details
#initialize(*coords) ⇒ Point
Returns a new instance of Point.
108 109 110 |
# File 'lib/hexagonly/point.rb', line 108 def initialize(*coords) set_coords(*coords) if coords.size == 2 end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
105 106 107 |
# File 'lib/hexagonly/point.rb', line 105 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
105 106 107 |
# File 'lib/hexagonly/point.rb', line 105 def y @y end |