lib/app/entities/game.rb in codebreaker_ruban-0.3.2 vs lib/app/entities/game.rb in codebreaker_ruban-0.3.4

- old
+ new

@@ -6,12 +6,14 @@ attr_reader :difficulty, :attempts_total, :hints_total, :user, :secret_code, :datetime attr_accessor :attempts_used, :hints_used, :errors LENGTH_GUESS = 4 RANGE_SECRET_CODE = (1..6).freeze - EASY = { hints_total: 2, attempts_total: 15, difficulty: 'easy' }.freeze - MEDIUM = { hints_total: 1, attempts_total: 10, difficulty: 'medium' }.freeze - HELL = { hints_total: 1, attempts_total: 5, difficulty: 'hell' }.freeze + DIFFICULTY = { + easy: { hints_total: 2, attempts_total: 15, difficulty: 'easy' }, + medium: { hints_total: 1, attempts_total: 10, difficulty: 'medium' }, + hell: { hints_total: 1, attempts_total: 5, difficulty: 'hell' } + } def initialize(difficulty, user) @user = user @difficulty = difficulty[:difficulty] @secret_code = generator_secret_code