Sha256: 2864627e209b745ba32d615bd3ed0f0b319e98dd28cf760e56b632c5673e480f

Contents?: true

Size: 365 Bytes

Versions: 9

Compression:

Stored size: 365 Bytes

Contents

module Codebreaker
  class User < BaseClass
    USERNAME_LENGTH_RANGE = (3..20).freeze

    attr_reader :username, :errors

    def initialize(username_new)
      @username = username_new
      @errors = {}
    end

    private

    def validate
      @errors[:user] = 'error_name_length' unless validate_length?(@username, USERNAME_LENGTH_RANGE)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
codebreaker-ga-0.2.14 lib/codebreaker/user.rb
codebreaker-ga-0.2.13 lib/codebreaker/user.rb
codebreaker-ga-0.2.12 lib/codebreaker/user.rb
codebreaker-ga-0.2.11 lib/codebreaker/user.rb
codebreaker-ga-0.2.10 lib/codebreaker/user.rb
codebreaker-ga-0.2.9 lib/codebreaker/user.rb
codebreaker-ga-0.2.8 lib/codebreaker/user.rb
codebreaker-ga-0.2.7 lib/codebreaker/user.rb
codebreaker-ga-0.2.6 lib/codebreaker/user.rb