Class: HabiticaClient::User::Stats

Inherits:
Object
  • Object
show all
Extended by:
Forwardable, Hashup
Defined in:
lib/habitica_client/user/stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Hashup

hashup

Constructor Details

#initialize(api_data) ⇒ Stats

Returns a new instance of Stats.



30
31
32
33
# File 'lib/habitica_client/user/stats.rb', line 30

def initialize(api_data)
  api_data['player_class'] = api_data['class'] # 'class' is reserved
  @stats = OpenStruct.new(api_data)
end

Instance Attribute Details

#statsObject (readonly)

Returns the value of attribute stats.



17
18
19
# File 'lib/habitica_client/user/stats.rb', line 17

def stats
  @stats
end