Class: User

Inherits:
Object
  • Object
show all
Defined in:
lib/modules/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ User

Returns a new instance of User.



5
6
7
8
9
10
11
# File 'lib/modules/user.rb', line 5

def initialize(name)
  return unless valid?(name)

  @name = name
  @used_attempts = 0
  @used_hints = 0
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/modules/user.rb', line 3

def name
  @name
end

#used_attemptsObject

Returns the value of attribute used_attempts.



2
3
4
# File 'lib/modules/user.rb', line 2

def used_attempts
  @used_attempts
end

#used_hintsObject

Returns the value of attribute used_hints.



2
3
4
# File 'lib/modules/user.rb', line 2

def used_hints
  @used_hints
end