Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/user.rb
Instance Attribute Summary collapse
-
#attempts_total ⇒ Object
readonly
Returns the value of attribute attempts_total.
-
#attempts_used ⇒ Object
Returns the value of attribute attempts_used.
-
#difficulty ⇒ Object
readonly
Returns the value of attribute difficulty.
-
#hints_total ⇒ Object
readonly
Returns the value of attribute hints_total.
-
#hints_used ⇒ Object
Returns the value of attribute hints_used.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, difficulty) ⇒ User
constructor
A new instance of User.
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_total ⇒ Object (readonly)
Returns the value of attribute attempts_total.
2 3 4 |
# File 'lib/user.rb', line 2 def attempts_total @attempts_total end |
#attempts_used ⇒ Object
Returns the value of attribute attempts_used.
3 4 5 |
# File 'lib/user.rb', line 3 def attempts_used @attempts_used end |
#difficulty ⇒ Object (readonly)
Returns the value of attribute difficulty.
2 3 4 |
# File 'lib/user.rb', line 2 def difficulty @difficulty end |
#hints_total ⇒ Object (readonly)
Returns the value of attribute hints_total.
2 3 4 |
# File 'lib/user.rb', line 2 def hints_total @hints_total end |
#hints_used ⇒ Object
Returns the value of attribute hints_used.
3 4 5 |
# File 'lib/user.rb', line 3 def hints_used @hints_used end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/user.rb', line 2 def name @name end |