Class: User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, difficulty) ⇒ User

Returns a new instance of User.


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

def initialize(name, difficulty)
  @name = name
  @difficulty = difficulty
  @hints_used = 0
  @attempts_used = 0
  check_difficulty(difficulty)
end

Instance Attribute Details

#attempts_totalObject (readonly)

Returns the value of attribute attempts_total.


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

def attempts_total
  @attempts_total
end

#attempts_usedObject

Returns the value of attribute attempts_used.


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

def attempts_used
  @attempts_used
end

#difficultyObject (readonly)

Returns the value of attribute difficulty.


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

def difficulty
  @difficulty
end

#hints_totalObject (readonly)

Returns the value of attribute hints_total.


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

def hints_total
  @hints_total
end

#hints_usedObject

Returns the value of attribute hints_used.


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

def hints_used
  @hints_used
end

#nameObject (readonly)

Returns the value of attribute name.


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

def name
  @name
end