lib/gameboard/cell.rb in gameboard-2.0.1 vs lib/gameboard/cell.rb in gameboard-3.0.0
- old
+ new
@@ -1,11 +1,21 @@
require_relative './coordinate'
module Gameboard
class Cell
+
+ # Public: Returns the value of the Cell instance.
attr_accessor :value
+
+ # Public: Retuns the Coordinate of the Cell instance. Returns type
+ # Gameboard::Coordinate.
attr_reader :coord
- def initialize(coord, value: false)
+ # Public: Initialize the Cell.
+ #
+ # coord - A Coordinate class instance at postition X,Y.
+ # value - The cell's value.
+ #
+ def initialize(coord: false, value: false)
raise TypeError unless coord.is_a?(Coordinate)
@value = value
@coord = coord
end
end