# frozen_string_literal: true class User < BaseClass VALID_NAME_RANGE = (3..20).freeze VALID_SYMBOLS_RANGE = ('a'..'z').freeze attr_accessor :name attr_reader :errors def initialize(name = 'Codebreaker') @name = name @errors = [] end def validate @errors << 'error_name_length' unless check_length_in_range?(@name, VALID_NAME_RANGE) @errors << 'error_name_chars' unless check_symbols_in_range?(@name, VALID_SYMBOLS_RANGE) end end