Class: AndriiCodebreaker::User
- Inherits:
-
Object
- Object
- AndriiCodebreaker::User
- Includes:
- Constant
- Defined in:
- lib/andrii_codebreaker/user.rb
Constant Summary
Constants included from Constant
Constant::CODE_LENGTH, Constant::CODE_LENGTH_COUNT, Constant::CODE_START_LENGTH, Constant::DIFFICULTY, Constant::DIFFICULTY_SORT, Constant::LALA, Constant::MINUS, Constant::NAME_MAX_LENGTH, Constant::NAME_MIN_LENGTH, Constant::PLUS, Constant::RANGE_SECRET_CODE, Constant::WIN
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(name) ⇒ User
Returns a new instance of User.
9 10 11 |
# File 'lib/andrii_codebreaker/user.rb', line 9 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/andrii_codebreaker/user.rb', line 7 def name @name end |
Class Method Details
.validate_name(name) ⇒ Object
13 14 15 |
# File 'lib/andrii_codebreaker/user.rb', line 13 def self.validate_name(name) name if name.length >= NAME_MIN_LENGTH && name.length <= NAME_MAX_LENGTH end |