Class: CodebreakerVk::Console

Inherits:
ValidatingData show all
Includes:
Uploader
Defined in:
lib/codebreaker_vk/console.rb

Constant Summary collapse

ACCEPT_SAVING_RESULT =
'yes'
COMMANDS =
{ rules: 'rules',
start: 'start',
stats: 'stats',
exit: 'exit' }.freeze

Constants included from Uploader

Uploader::PATH, Uploader::PATH_FOLDER, Uploader::PATH_FORMAT, Uploader::PATH_NAME

Instance Method Summary collapse

Methods included from Uploader

#load_db, #save_to_db

Methods inherited from ValidatingData

#initialize, #valid?, #validate

Methods included from Validate

#check_cover?, #check_include?, #check_numbers?, #check_size?

Constructor Details

This class inherits a constructor from CodebreakerVk::ValidatingData

Instance Method Details

#greetingObject



13
14
15
# File 'lib/codebreaker_vk/console.rb', line 13

def greeting
  Representer.greeting_msg
end


17
18
19
20
21
22
23
24
25
26
# File 'lib/codebreaker_vk/console.rb', line 17

def main_menu
  loop do
    Representer.what_next_text
    case make_valid_input_for_class(Navigator).input
    when COMMANDS[:start] then return registration
    when COMMANDS[:rules] then Representer.show_rules
    when COMMANDS[:stats] then statistics
    end
  end
end