Class: Minesweeper::BoardBuilder

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/minesweeper/board_builder.rb

Overview

create empty instance of board fill it with cells & bomb cells return assembled instance of board

Instance Method Summary collapse

Constructor Details

#initialize(flush_params) ⇒ BoardBuilder

Returns a new instance of BoardBuilder.



10
11
12
# File 'lib/minesweeper/board_builder.rb', line 10

def initialize(flush_params)
  @flush_params = flush_params
end

Instance Method Details

#buildObject



14
15
16
17
18
19
20
# File 'lib/minesweeper/board_builder.rb', line 14

def build
  @board_params = params_builder.prepare
  @board = create_board
  fill_with_cells
  inject_bombs
  board
end