diff --git a/lib/sightstone/modules/summoner_module.rb b/lib/sightstone/modules/summoner_module.rb index 4e0a7ea..20a649b 100644 --- a/lib/sightstone/modules/summoner_module.rb +++ b/lib/sightstone/modules/summoner_module.rb @@ -75,14 +75,14 @@ class SummonerModule < SightstoneBaseModule def names(ids, optional={}) region = optional[:region] || @sightstone.region ids = ids.join(',') - uri = "http://prod.api.pvp.net/api/lol/#{region}/v1.2/summoner/#{ids}/name" + uri = "http://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/#{ids}/name" response = _get_api_response(uri) _parse_response(response) { |resp| data = JSON.parse(resp) - names_array = data['summoners'] + names_hash = Hash.new - names_array.each do |summoner| - names_hash[summoner['id']] = summoner['name'] + data.each do |id, name| + names_hash[id.to_i] = name end if block_given? yield names_hash diff --git a/sightstone.gemspec b/sightstone.gemspec index b5a6f1f..bd4b8da 100644 --- a/sightstone.gemspec +++ b/sightstone.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'sightstone' - s.version = '1.4.1' - s.date = '2014-01-17' + s.version = '1.4.2' + s.date = '2014-03-14' s.summary = 'Ruby wrapper for riots league of legends api' s.description = s.summary s.authors = ["Daniel Bauer"]