Class: Console
- Inherits:
-
Object
- Object
- Console
- Includes:
- CodebreakerParatskiy, Output, Validating
- Defined in:
- lib/console.rb
Constant Summary
Constants included from CodebreakerParatskiy
Instance Attribute Summary collapse
-
#user_code ⇒ Object
Returns the value of attribute user_code.
Instance Method Summary collapse
-
#initialize ⇒ Console
constructor
A new instance of Console.
- #main_menu ⇒ Object
- #run ⇒ Object
Methods included from Output
#generate_table_titles, #generate_table_values, #show_main_menu, #show_msg, #show_rules, #show_stats, #show_welcome
Methods included from Validating
Methods included from CodebreakerParatskiy
Constructor Details
#initialize ⇒ Console
Returns a new instance of Console.
8 9 10 |
# File 'lib/console.rb', line 8 def initialize @user_code = [] end |
Instance Attribute Details
#user_code ⇒ Object
Returns the value of attribute user_code.
6 7 8 |
# File 'lib/console.rb', line 6 def user_code @user_code end |
Instance Method Details
#main_menu ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/console.rb', line 17 def answer = user_enter return (answer) if MAIN_MENU_COMMANDS.include?(answer) show_msg(:InvalidCommand) end |
#run ⇒ Object
12 13 14 15 |
# File 'lib/console.rb', line 12 def run show_welcome end |