class NewSuperCodebreaker2021::User
Constants
- DIFFICULTY
Attributes
attempts_total[R]
attempts_used[RW]
difficulty[R]
hints_total[R]
hints_used[RW]
name[R]
Public Class Methods
new(name, difficulty)
click to toggle source
# File lib/new_super_codebreaker_2021/user.rb, line 12 def initialize(name, difficulty) @name = name @difficulty = difficulty @hints_used = 0 @attempts_used = 0 set_total_fields end
Private Instance Methods
set_total_fields()
click to toggle source
# File lib/new_super_codebreaker_2021/user.rb, line 22 def set_total_fields difficulty = DIFFICULTY.keys[@difficulty] @hints_total = DIFFICULTY[difficulty][:hints] @attempts_total = DIFFICULTY[difficulty][:attempts] end