Class: Codebreaker::Player

Inherits:
Object
  • Object
show all
Defined in:
lib/codebreaker/entities/player.rb

Constant Summary collapse

MAX_LENGTH_NAME =
20
MIN_LENGTH_NAME =
3

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

#validateObject



13
14
15
# File 'lib/codebreaker/entities/player.rb', line 13

def validate
  Verifier.verify_valid_name(@name)
end