Class: Hexagonly::Point

Inherits:
Object
  • Object
show all
Includes:
Methods
Defined in:
lib/hexagonly/point.rb

Defined Under Namespace

Modules: Methods

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#xObject

Returns the value of attribute x.



105
106
107
# File 'lib/hexagonly/point.rb', line 105

def x
  @x
end

#yObject

Returns the value of attribute y.



105
106
107
# File 'lib/hexagonly/point.rb', line 105

def y
  @y
end