Sha256: 9cd93497f8656d135522932e443fa4935afd978e8c3fddef84627b5d4acde406

Contents?: true

Size: 375 Bytes

Versions: 10

Compression:

Stored size: 375 Bytes

Contents

# frozen_string_literal: true

module CodebreakerRuban
  class User
    include Validation
    attr_accessor :errors
    attr_reader :name

    RANGE_NAME = (3..20).freeze

    def initialize(name)
      @name = name
      @errors = []
    end

    def validate(name)
      return errors << Message.error_name_size(RANGE_NAME) unless size(name, RANGE_NAME)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
codebreaker_ruban-0.3.8 lib/app/entities/user.rb
codebreaker_ruban-0.3.7 lib/app/entities/user.rb
codebreaker_ruban-0.3.6 lib/app/entities/user.rb
codebreaker_ruban-0.3.5 lib/app/entities/user.rb
codebreaker_ruban-0.3.4 lib/app/entities/user.rb
codebreaker_ruban-0.3.2 lib/app/entities/user.rb
codebreaker_ruban-0.3.1 lib/app/entities/user.rb
codebreaker_ruban-0.3.0 lib/app/entities/user.rb
codebreaker_ruban-0.2.0 lib/app/entities/user.rb
codebreaker_ruban-0.1.0 lib/app/entities/user.rb