Class: TTT::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/ttt/setup.rb

Instance Method Summary collapse

Instance Method Details

#boardsObject



10
11
12
# File 'lib/ttt/setup.rb', line 10

def boards
  ConfigHelper.board_types
end

#dbObject



29
30
31
# File 'lib/ttt/setup.rb', line 29

def db
  ConfigHelper.get_db_const
end

#interactorObject



33
34
35
# File 'lib/ttt/setup.rb', line 33

def interactor
  ConfigHelper.get_game_interactor_const
end

#new_dbObject



21
22
23
# File 'lib/ttt/setup.rb', line 21

def new_db
  instantiate_db
end

#new_game(options) ⇒ Object



14
15
16
17
18
19
# File 'lib/ttt/setup.rb', line 14

def new_game(options)
  Game.new(:player1 => instantiate_player(1, options.fetch(:player1)),
           :player2 => instantiate_player(2, options.fetch(:player2)),
           :board   => instantiate_board(options.fetch(:board)),
           :history => instantiate_history)
end

#new_interactorObject



25
26
27
# File 'lib/ttt/setup.rb', line 25

def new_interactor
  instantiate_interactor
end

#playersObject



6
7
8
# File 'lib/ttt/setup.rb', line 6

def players
  ConfigHelper.player_types
end