class CodebreakerGem::Player
Constants
- NAME_LENGTH_RANGE
Attributes
errors[R]
name[R]
Public Class Methods
new(name)
click to toggle source
Calls superclass method
# File lib/app/entities/player.rb, line 9 def initialize(name) super() @name = name end
Public Instance Methods
validate()
click to toggle source
# File lib/app/entities/player.rb, line 14 def validate @errors << failing.player_name_length unless check_name_length end
Private Instance Methods
check_name_length()
click to toggle source
# File lib/app/entities/player.rb, line 20 def check_name_length NAME_LENGTH_RANGE.include?(@name.length) end