module Output class Messages class << self ARROW = '~> '.freeze def clear system('clear') end def stats_error puts I18n.t :stats_error end def show_stats(stat) puts I18n.t(:show_stats, rating: stat[:rating], name: stat[:name], difficult: stat[:difficult].level, attempts: (stat[:attempts] + stat[:attempts_used]), attempts_used: stat[:attempts_used], hints: (stat[:hints] + stat[:hints_used]), hints_used: stat[:hints_used]) end def show_greeting clear puts I18n.t :greeting puts I18n.t :menu end def show_rules puts I18n.t :rules end def show_bye puts I18n.t :goodbye end def show_game_info(game) puts '===================' puts I18n.t(:game_hints, hints: game.hints) puts I18n.t(:game_attempts, attempts: game.attempts) puts I18n.t :game_help print ARROW end def get_hint(game) return Messages.hint_error if game.hints.zero? puts "[#{game.use_hint}] - one of the number" end def show_difficult puts I18n.t :set_difficult puts I18n.t :difficult print ARROW end def show_name puts I18n.t :set_name, min: 3 print ARROW end def game_commands puts I18n.t :game_commands end def start_again puts I18n.t :start_again print ARROW end def win puts I18n.t :win end def save_stats puts I18n.t :save_stats print ARROW end def name_error puts I18n.t :name_error, min: 3, max: 20 end def lose puts I18n.t :lose end def difficult_error puts I18n.t :difficult_error end def hint_error puts I18n.t :hint_error end def unknown_command puts I18n.t :unknown_command end end end end