Sha256: 06ba2ffc2fb8b5a732e3288d90b06e6ded68524f0d09d145f492c4b29f8d0850
Contents?: true
Size: 542 Bytes
Versions: 9
Compression:
Stored size: 542 Bytes
Contents
# 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
Version data entries
9 entries across 9 versions & 1 rubygems