lib/game.rb in codebreaker_paratskiy-0.1.6 vs lib/game.rb in codebreaker_paratskiy-0.1.7

- old
+ new

@@ -2,10 +2,10 @@ require_relative 'services/statistic_service' class Game attr_accessor :player_name, :secret_code, :user_code, :attempts, :hints, :difficulty_name attr_reader :stats, :secret_code_for_hint - def initialize(player_name, difficulty) + def initialize(player_name = DEFAULT_NAME, difficulty = DIFFICULTIES[:default]) @stats = Statistic.stats || [] @player_name = player_name @difficulty_name = DIFFICULTIES.key(difficulty).to_s @attempts = difficulty[:attempts] @hints = difficulty[:hints]