class TicTacToeRZ::Players::Player
Attributes
symbol[R]
type[R]
Public Class Methods
new(type, symbol)
click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/players/player.rb, line 11 def initialize(type, symbol) raise Exceptions::NilReferenceError, "type" if type.nil? raise Exceptions::InvalidValueError, "symbol" if !Validators::PlayerSymbolValidator.valid?(symbol) @type = type @symbol = symbol end
Public Instance Methods
equals?(player)
click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/players/player.rb, line 18 def equals?(player) isEqual = @type == player.type && @symbol == player.symbol end