Class: Hexagonly::Space

Inherits:
Object
  • Object
show all
Defined in:
lib/hexagonly/space.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(points) ⇒ Space

Returns a new instance of Space.

Parameters:

  • points (Array<Hexagonly::Point>)

    an array of points that make up the space



7
8
9
10
# File 'lib/hexagonly/space.rb', line 7

def initialize(points)
  @points = points
  refresh
end

Instance Attribute Details

#centerObject (readonly)

Returns the value of attribute center.



4
5
6
# File 'lib/hexagonly/space.rb', line 4

def center
  @center
end

#eastObject (readonly)

Returns the value of attribute east.



4
5
6
# File 'lib/hexagonly/space.rb', line 4

def east
  @east
end

#heightObject (readonly)

Returns the value of attribute height.



4
5
6
# File 'lib/hexagonly/space.rb', line 4

def height
  @height
end

#northObject (readonly)

Returns the value of attribute north.



4
5
6
# File 'lib/hexagonly/space.rb', line 4

def north
  @north
end

#pointsObject (readonly)

Returns the value of attribute points.



4
5
6
# File 'lib/hexagonly/space.rb', line 4

def points
  @points
end

#southObject (readonly)

Returns the value of attribute south.



4
5
6
# File 'lib/hexagonly/space.rb', line 4

def south
  @south
end

#westObject (readonly)

Returns the value of attribute west.



4
5
6
# File 'lib/hexagonly/space.rb', line 4

def west
  @west
end

#widthObject (readonly)

Returns the value of attribute width.



4
5
6
# File 'lib/hexagonly/space.rb', line 4

def width
  @width
end