Class: Menu
Constant Summary collapse
- COMMANDS =
{ start: 'start', exit: 'exit', rules: 'rules', stats: 'stats' }.freeze
- CHOOSE_COMMANDS =
{ yes: 'yes' }.freeze
- HINT_COMMAND =
'hint'- MIN_SIZE_VALUE =
3- MAX_SIZE_VALUE =
20
Constants included from Validator
Instance Attribute Summary collapse
-
#game ⇒ Object
readonly
Returns the value of attribute game.
-
#guess ⇒ Object
readonly
Returns the value of attribute guess.
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
- #game_menu ⇒ Object
-
#initialize ⇒ Menu
constructor
A new instance of Menu.
Methods included from Validator
#check_command_range, #check_emptyness, #check_length
Constructor Details
#initialize ⇒ Menu
Returns a new instance of Menu.
20 21 22 23 24 25 |
# File 'lib/app/entities/menu.rb', line 20 def initialize @storage = DataStorage.new @renderer = Renderer.new @game = Game.new @statistics = Statistics.new end |
Instance Attribute Details
#game ⇒ Object (readonly)
Returns the value of attribute game.
5 6 7 |
# File 'lib/app/entities/menu.rb', line 5 def game @game end |
#guess ⇒ Object (readonly)
Returns the value of attribute guess.
5 6 7 |
# File 'lib/app/entities/menu.rb', line 5 def guess @guess end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer.
5 6 7 |
# File 'lib/app/entities/menu.rb', line 5 def renderer @renderer end |
#storage ⇒ Object (readonly)
Returns the value of attribute storage.
5 6 7 |
# File 'lib/app/entities/menu.rb', line 5 def storage @storage end |
Instance Method Details
#game_menu ⇒ Object
27 28 29 30 |
# File 'lib/app/entities/menu.rb', line 27 def renderer. (ask(:choice_options, commands: COMMANDS.keys.join(' | '))) end |