# frozen_string_literal: true module Codebreaker class Difficulty < BaseClass LEVELS = { easy: { attempts: 15, hints: 3, name: 'easy', id: 1 }, medium: { attempts: 10, hints: 2, name: 'medium', id: 2 }, hell: { attempts: 5, hints: 1, name: 'hell', id: 3 } }.freeze attr_reader :errors, :level def initialize(level = :easy) @level = LEVELS[level.to_sym] @errors = [] end def validate @errors << 'unexpected_comand' unless LEVELS.values.include? @level end end end