module Console1984::InputOutput
Private Instance Methods
ask_for_session_reason()
click to toggle source
# File lib/console1984/input_output.rb, line 14 def ask_for_session_reason ask_for_value("#{current_username}, why are you using this console today?") end
ask_for_value(message)
click to toggle source
# File lib/console1984/input_output.rb, line 32 def ask_for_value(message) puts ColorizedString.new("#{message}").green reason = $stdin.gets.strip until reason.present? reason end
show_commands()
click to toggle source
# File lib/console1984/input_output.rb, line 18 def show_commands puts <<~TXT Commands: #{COMMANDS.collect { |command, help_line| "* #{ColorizedString.new(command.to_s).light_blue}: #{help_line}" }.join("\n")} TXT end
show_production_data_warning()
click to toggle source
# File lib/console1984/input_output.rb, line 10 def show_production_data_warning show_warning Console1984.production_data_warning end
show_warning(message)
click to toggle source
# File lib/console1984/input_output.rb, line 28 def show_warning(message) puts ColorizedString.new("\n#{message}\n").yellow end
show_welcome_message()
click to toggle source
# File lib/console1984/input_output.rb, line 5 def show_welcome_message show_production_data_warning show_commands end