Class: Brawlhalla::API::LegendStat
- Inherits:
-
Object
- Object
- Brawlhalla::API::LegendStat
- Defined in:
- lib/brawlhalla/api/legend_stat.rb
Constant Summary collapse
- ATTRIBUTES =
i[ legend_id legend_name_key damagedealt damagetaken kos falls suicides teamkos matchtime games wins damageunarmed damagethrownitem damageweaponone damageweapontwo damagegadgets kounarmed kothrownitem koweaponone koweapontwo kogadgets timeheldweaponone timeheldweapontwo xp level xp_percentage ]
Instance Method Summary collapse
-
#initialize(json) ⇒ LegendStat
constructor
A new instance of LegendStat.
Constructor Details
#initialize(json) ⇒ LegendStat
Returns a new instance of LegendStat.
15 16 17 18 19 20 21 22 |
# File 'lib/brawlhalla/api/legend_stat.rb', line 15 def initialize(json) ATTRIBUTES.each do |attr| value = json[attr] value = value.to_i if attr.to_s.start_with?('damage') send("#{attr}=", value) end end |