Module: TicTacToe::PlayerFactory

Defined in:
lib/player_factory.rb

Class Method Summary collapse

Class Method Details

.build(config) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/player_factory.rb', line 7

def self.build(config)
  case config[:type]
  when AvailablePlayerTypes::HUMAN
    create_human_player(config)
  when AvailablePlayerTypes::COMPUTER
    create_computer_player(config)
  end
end