Class: BeforeGame::DifficultChooser
- Inherits:
-
Object
- Object
- BeforeGame::DifficultChooser
- Defined in:
- lib/codebreaker/before_game/difficult_chooser.rb
Constant Summary collapse
- DIFFICULT_VARIANTS =
[ { name: 'easy', attempts: 15, hints: 2 }, { name: 'medium', attempts: 10, hints: 1 }, { name: 'hell', attempts: 5, hints: 1 } ].freeze
Instance Attribute Summary collapse
-
#attempts_count ⇒ Object
Returns the value of attribute attempts_count.
-
#hint ⇒ Object
Returns the value of attribute hint.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(difficult_variant:) ⇒ DifficultChooser
constructor
A new instance of DifficultChooser.
Constructor Details
#initialize(difficult_variant:) ⇒ DifficultChooser
Returns a new instance of DifficultChooser.
13 14 15 16 17 |
# File 'lib/codebreaker/before_game/difficult_chooser.rb', line 13 def initialize(difficult_variant:) @name = difficult_variant[:name] @attempts_count = difficult_variant[:attempts] @hint = BeforeGame::Hint.new(hints_count: difficult_variant[:hints]) end |
Instance Attribute Details
#attempts_count ⇒ Object
Returns the value of attribute attempts_count.
11 12 13 |
# File 'lib/codebreaker/before_game/difficult_chooser.rb', line 11 def attempts_count @attempts_count end |
#hint ⇒ Object
Returns the value of attribute hint.
11 12 13 |
# File 'lib/codebreaker/before_game/difficult_chooser.rb', line 11 def hint @hint end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/codebreaker/before_game/difficult_chooser.rb', line 11 def name @name end |