Class: Sightstone::RankedStats
- Inherits:
-
Object
- Object
- Sightstone::RankedStats
- Defined in:
- lib/sightstone/ranked_stats.rb
Instance Attribute Summary collapse
-
#champions ⇒ Hash<Fixnum, Hash<String, Fixnum>>
Statisitc for each champion in a Hash.
-
#modifyDate ⇒ Object
Returns the value of attribute modifyDate.
-
#summonerId ⇒ Object
Returns the value of attribute summonerId.
Instance Method Summary collapse
-
#initialize(data) ⇒ RankedStats
constructor
A new instance of RankedStats.
Constructor Details
#initialize(data) ⇒ RankedStats
Returns a new instance of RankedStats.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sightstone/ranked_stats.rb', line 9 def initialize(data) @summonerId = data['summonerId'] @modifyDate = data['modifyDate'] @champions = {} data['champions'].each do |champ| id = champ['id'] @champions[id] = Hash.new unless @champions.has_key? id stat_keys = champ['stats'].keys stat_keys.each do |key| @champions[id][key] = champ['stats'][key] end end end |
Instance Attribute Details
#champions ⇒ Hash<Fixnum, Hash<String, Fixnum>>
Statisitc for each champion in a Hash. Each key stands for a champions id (0 is sum of all champs) and returns a Hash<stat, stat_value>.
6 7 8 |
# File 'lib/sightstone/ranked_stats.rb', line 6 def champions @champions end |
#modifyDate ⇒ Object
Returns the value of attribute modifyDate.
7 8 9 |
# File 'lib/sightstone/ranked_stats.rb', line 7 def modifyDate @modifyDate end |
#summonerId ⇒ Object
Returns the value of attribute summonerId.
7 8 9 |
# File 'lib/sightstone/ranked_stats.rb', line 7 def summonerId @summonerId end |