Class: TTT::Setup
- Inherits:
-
Object
- Object
- TTT::Setup
- Defined in:
- lib/ttt/setup.rb
Instance Method Summary collapse
- #boards ⇒ Object
- #db ⇒ Object
- #interactor ⇒ Object
- #new_db ⇒ Object
- #new_game(options) ⇒ Object
- #new_interactor ⇒ Object
- #players ⇒ Object
Instance Method Details
#boards ⇒ Object
10 11 12 |
# File 'lib/ttt/setup.rb', line 10 def boards ConfigHelper.board_types end |
#db ⇒ Object
29 30 31 |
# File 'lib/ttt/setup.rb', line 29 def db ConfigHelper.get_db_const end |
#interactor ⇒ Object
33 34 35 |
# File 'lib/ttt/setup.rb', line 33 def interactor ConfigHelper.get_game_interactor_const end |
#new_db ⇒ Object
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() Game.new(:player1 => instantiate_player(1, .fetch(:player1)), :player2 => instantiate_player(2, .fetch(:player2)), :board => instantiate_board(.fetch(:board)), :history => instantiate_history) end |
#new_interactor ⇒ Object
25 26 27 |
# File 'lib/ttt/setup.rb', line 25 def new_interactor instantiate_interactor end |
#players ⇒ Object
6 7 8 |
# File 'lib/ttt/setup.rb', line 6 def players ConfigHelper.player_types end |