Class: CodeBrkrGameTraining::User

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

Overview

Class for game user

Constant Summary collapse

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

Constants included from Validator

Validator::DataValidError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validator

#check_contain_hash_key, #check_length, #check_type

Constructor Details

#initialize(name) ⇒ User

Returns a new instance of User.



13
14
15
16
# File 'lib/code_brkr_game_training/entities/user.rb', line 13

def initialize(name)
  @name = name
  validate
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end