# frozen_string_literal: true class Guess < BaseClass VALID_GUESS_LENGTH = 4 VALID_GUESS_RANGE = ('0'..'6').freeze attr_accessor :number attr_reader :errors def initialize(guess) @number = guess @errors = [] end def validate @errors << 'error_number_length' unless check_length?(@number, VALID_GUESS_LENGTH) @errors << 'error_number_digit' unless check_number_in_range?(@number, VALID_GUESS_RANGE) end end