lib/smite/data_transform.rb in smite_ruby-1.4.3 vs lib/smite/data_transform.rb in smite_ruby-1.4.5

- old
+ new

@@ -4,19 +4,19 @@ def transform_items(data) item_fields = data.slice(*item_map_fields) return data if item_fields.empty? - data['items'] = item_fields.values.map { |id| Smite::Game.item(id.to_i) } + data['items'] = item_fields.values.map { |id| Smite::Game.item(id) } data.except(*item_filter_fields) end def transform_gods(data) god_fields = data.slice(*god_map_fields) return data if god_fields.empty? - data['god'] = god_fields.values.map { |id| Smite::Game.god(id.to_i) }[0] + data['god'] = god_fields.values.map { |id| Smite::Game.god(id) }[0] data.except(*god_filter_fields) end def transform_abilities(data) ability_fields = data.slice(*ability_map_fields) @@ -30,17 +30,17 @@ end data.except(*ability_filter_fields) end - def transform_match(data) - return data unless data['Queue'] + def transform_recent_match(data) + return data unless data['queue'] - if data['Queue'] =~ /League/ + if data['queue'] =~ /League/ data else - data.except(*match_filter_fields) + data.except(*recent_match_filter_fields) end end def transform_stats(data) stat_fields = data.slice(*stats_map_fields) @@ -96,11 +96,11 @@ ability_description5 god_ability1_url god_ability2_url god_ability3_url god_ability4_url god_ability5_url ) end - def match_filter_fields + def recent_match_filter_fields %w( ban1 ban2 ban3 ban4 ban5 ban6 ban1_id ban2_id ban3_id ban4_id ban5_id ban6_id ) @@ -127,10 +127,10 @@ def god_map_fields %w(god_id) end def god_filter_fields - god_map_fields + %w(god) + god_map_fields end end end end \ No newline at end of file