Class: Conway::CellLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/conway/cell_location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cell, point) ⇒ CellLocation

Returns a new instance of CellLocation.



5
6
7
8
# File 'lib/conway/cell_location.rb', line 5

def initialize(cell, point)
  @cell  = cell
  @point = point
end

Instance Attribute Details

#cellObject (readonly)

Returns the value of attribute cell.



3
4
5
# File 'lib/conway/cell_location.rb', line 3

def cell
  @cell
end

#pointObject (readonly)

Returns the value of attribute point.



3
4
5
# File 'lib/conway/cell_location.rb', line 3

def point
  @point
end

Instance Method Details

#adjacent_pointsObject



10
11
12
# File 'lib/conway/cell_location.rb', line 10

def adjacent_points
  point.adjacents
end