# frozen_string_literal: true module Codebreaker class User include Validation attr_reader :name, :attempts, :hints, :difficulty def initialize(name) validate_name(name) @name = name end def assign_user_config(difficulty) @difficulty = difficulty @attempts = Constants::DIFFICULTIES[@difficulty][:attempts] @hints = Constants::DIFFICULTIES[@difficulty][:hints] end def decrement_attemts @attempts -= 1 end def decrement_hints @hints -= 1 end end end