Class: Minesweeper::ParamsBuilder
- Inherits:
-
Object
- Object
- Minesweeper::ParamsBuilder
- Extended by:
- Forwardable
- Defined in:
- lib/minesweeper/params_builder.rb
Overview
used for reading / creating board params.
Constant Summary collapse
- DEFAULTS =
{ height: 10, width: 10, level: 'advanced' }.freeze
Instance Attribute Summary collapse
-
#flush_params ⇒ Object
readonly
Returns the value of attribute flush_params.
-
#ui ⇒ Object
readonly
Returns the value of attribute ui.
Instance Method Summary collapse
-
#initialize(flush_params) ⇒ ParamsBuilder
constructor
A new instance of ParamsBuilder.
- #prepare ⇒ Object
Constructor Details
#initialize(flush_params) ⇒ ParamsBuilder
Returns a new instance of ParamsBuilder.
12 13 14 15 |
# File 'lib/minesweeper/params_builder.rb', line 12 def initialize(flush_params) @flush_params = flush_params @ui = Minesweeper::Ui end |
Instance Attribute Details
#flush_params ⇒ Object (readonly)
Returns the value of attribute flush_params.
10 11 12 |
# File 'lib/minesweeper/params_builder.rb', line 10 def flush_params @flush_params end |
#ui ⇒ Object (readonly)
Returns the value of attribute ui.
10 11 12 |
# File 'lib/minesweeper/params_builder.rb', line 10 def ui @ui end |
Instance Method Details
#prepare ⇒ Object
19 20 21 22 |
# File 'lib/minesweeper/params_builder.rb', line 19 def prepare entry && entry.delete if flush_params entry || build end |