Class: Codebreaker::Entities::User

Inherits:
Object
  • Object
show all
Includes:
Validator
Defined in:
lib/codebreaker_marian/entities/user.rb

Constant Summary collapse

USERNAME_CONSTRAINTS =
{ min: 3, max: 20 }.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validator

#check_length, #check_type

Constructor Details

#initialize(name) ⇒ User

Returns a new instance of User.



11
12
13
14
# File 'lib/codebreaker_marian/entities/user.rb', line 11

def initialize(name)
  @name = name
  validate
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/codebreaker_marian/entities/user.rb', line 9

def name
  @name
end