Class: Codebreaker::Player
- Inherits:
-
Object
- Object
- Codebreaker::Player
- Defined in:
- lib/codebreaker/entities/player.rb
Constant Summary collapse
- MAX_LENGTH_NAME =
20
- MIN_LENGTH_NAME =
3
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Player
constructor
A new instance of Player.
- #validate ⇒ Object
Constructor Details
#initialize(name) ⇒ Player
Returns a new instance of Player.
9 10 11 |
# File 'lib/codebreaker/entities/player.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/codebreaker/entities/player.rb', line 7 def name @name end |
Instance Method Details
#validate ⇒ Object
13 14 15 |
# File 'lib/codebreaker/entities/player.rb', line 13 def validate Verifier.verify_valid_name(@name) end |