Module: TicTacToe::Player

Defined in:
lib/tic_tac_toe/player.rb,
lib/tic_tac_toe/players/human_player.rb,
lib/tic_tac_toe/players/computer_player.rb

Defined Under Namespace

Modules: MoveJson Classes: Computer, Human

Constant Summary collapse

HUMAN =
'human'
COMPUTER =
'computer'

Class Method Summary collapse

Class Method Details

.build(params) ⇒ Object



6
7
8
9
10
# File 'lib/tic_tac_toe/player.rb', line 6

def self.build(params)
  return Player::Human.new(params) if params['type'] == HUMAN

  Player::Computer.new(params)
end