Class: Codebreaker::User

Inherits:
Object
  • Object
show all
Includes:
Validations
Defined in:
lib/codebreaker/user.rb

Constant Summary collapse

NAME_LENGTH =
(3..20).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validations

included

Constructor Details

#initialize(name) ⇒ User

Returns a new instance of User.



14
15
16
17
# File 'lib/codebreaker/user.rb', line 14

def initialize(name)
  @name = name
  validate!
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/codebreaker/user.rb', line 8

def name
  @name
end