Class: Codebreaker::Player

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validation

#guess_valid?, #size_correct?

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



6
7
8
# File 'lib/codebreaker/player.rb', line 6

def errors
  @errors
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/codebreaker/player.rb', line 7

def name
  @name
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/codebreaker/player.rb', line 9

def valid?
  validate
  errors.empty?
end