diff --git a/lib/sightstone/modules/league_module.rb b/lib/sightstone/modules/league_module.rb index de8bce6..afa131e 100644 --- a/lib/sightstone/modules/league_module.rb +++ b/lib/sightstone/modules/league_module.rb @@ -21,14 +21,13 @@ class LeagueModule < SightstoneBaseModule summoner end - uri = "https://prod.api.pvp.net/api/lol/#{region}/v2.2/league/by-summoner/#{id}" + uri = "https://prod.api.pvp.net/api/lol/#{region}/v2.3/league/by-summoner/#{id}" response = _get_api_response(uri) _parse_response(response) { |resp| data = JSON.parse(resp) - leagueKeys = data.keys leagues = [] - leagueKeys.each do |key| - leagues << League.new(data[key]) + data.each do |league| + leagues << League.new(league) end if block_given? yield leagues diff --git a/sightstone.gemspec b/sightstone.gemspec index 58f8c16..b5a6f1f 100644 --- a/sightstone.gemspec +++ b/sightstone.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'sightstone' - s.version = '1.4.0' + s.version = '1.4.1' s.date = '2014-01-17' s.summary = 'Ruby wrapper for riots league of legends api' s.description = s.summary diff --git a/test/test_base.rb b/test/test_base.rb index 8bdf446..217434a 100644 --- a/test/test_base.rb +++ b/test/test_base.rb @@ -3,10 +3,11 @@ require 'sightstone' class BaseTest < Test::Unit::TestCase - @@sightstone = Sightstone::Sightstone.new("your_test_api_key") + @@sightstone = Sightstone::Sightstone.new("your_api_key_here") @@req_id = 30447079 @@test_id_array = [30447079,30447079,30447079] @@test_name = "danijoo" + @@test_name2 = "pippu" end