class TicTacToe::Cell

Constants

EMPTY

Attributes

empty[RW]
sign[RW]

Public Class Methods

new() click to toggle source
# File examples/tic_tac_toe/cell.rb, line 27
def initialize
  reset!
end

Public Instance Methods

mark(sign) click to toggle source
# File examples/tic_tac_toe/cell.rb, line 31
def mark(sign)
  self.sign = sign
end
marked() click to toggle source
# File examples/tic_tac_toe/cell.rb, line 44
def marked
  !empty
end
reset!() click to toggle source
# File examples/tic_tac_toe/cell.rb, line 35
def reset!
  self.sign = EMPTY
end
sign=(sign_symbol) click to toggle source
# File examples/tic_tac_toe/cell.rb, line 39
def sign=(sign_symbol)
  @sign = sign_symbol
  self.empty = sign == EMPTY
end