class TicTacToe::Cell

Constants

EMPTY_SYMBOL

Attributes

owner[RW]
position[RW]

Public Class Methods

new(position, owner = nil) click to toggle source
# File lib/tic_tac_toe/cell.rb, line 8
def initialize(position, owner = nil)
  @position = position
  @owner = owner
end

Public Instance Methods

content() click to toggle source
# File lib/tic_tac_toe/cell.rb, line 21
def content
  empty? ? EMPTY_SYMBOL : @owner.symbol
end
empty?() click to toggle source
# File lib/tic_tac_toe/cell.rb, line 17
def empty?
  @owner.nil?
end
owner?(owner) click to toggle source
# File lib/tic_tac_toe/cell.rb, line 13
def owner?(owner)
  owner == @owner
end