Class: Conway::CellLocation
- Inherits:
-
Object
- Object
- Conway::CellLocation
- Defined in:
- lib/conway/cell_location.rb
Instance Attribute Summary collapse
-
#cell ⇒ Object
readonly
Returns the value of attribute cell.
-
#point ⇒ Object
readonly
Returns the value of attribute point.
Instance Method Summary collapse
- #adjacent_points ⇒ Object
-
#initialize(cell, point) ⇒ CellLocation
constructor
A new instance of CellLocation.
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
#cell ⇒ Object (readonly)
Returns the value of attribute cell.
3 4 5 |
# File 'lib/conway/cell_location.rb', line 3 def cell @cell end |
#point ⇒ Object (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_points ⇒ Object
10 11 12 |
# File 'lib/conway/cell_location.rb', line 10 def adjacent_points point.adjacents end |