lib/sightstone/modules/summoner_module.rb
def runebooks(summoners, optional={})
    return {} if summoners.empty?

    region = optional[:region] || @sightstone.region
    ids = summoners.collect { |summoner|
      if summoner.is_a? Summoner
        summoner.id
      else
        summoner
      end
    }
    uri = "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/#{ids.join(',')}/runes"
    response = _get_api_response(uri)
    _parse_response(response) { |resp|
      data = JSON.parse(resp)
      books = {}
      data.each do |key, raw_book|
        books[key] = RuneBook.new(raw_book)
      end
      if block_given?
        yield books
      else
        return books
      end
    }
  end
def runebooks(summoners, optional={})
    return {} if summoners.empty?

    region = optional[:region] || @sightstone.region
    ids = summoners.collect { |summoner|
      if summoner.is_a? Summoner
        summoner.id
      else
        summoner
      end
    }
    uri = "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/#{ids.join(',')}/runes"
    response = _get_api_response(uri)
    _parse_response(response) { |resp|
      data = JSON.parse(resp)
      books = {}
      data.each do |key, raw_book|
        books[key] = RuneBook.new(raw_book)
      end
      if block_given?
        yield books
      else
        return books
      end
    }
  end
def runebooks ( summoners , optional = { } ) return { } if summoners . empty? region = optional [ :region ] || @sightstone . region ids = summoners . collect { | summoner | if summoner . is_a? Summoner summoner . id else summoner end } uri = "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/#{ids.join(',')}/runes" response = _get_api_response ( uri ) _parse_response ( response ) { | resp | data = JSON . parse ( resp ) books = { } data . each do | key , raw_book | books [ key ] = RuneBook . new ( raw_book ) end if block_given? yield books else return books end } end
returns the runebook for multiple summoners
 @param summoners [Array<(Summoner, Integer)>] list of summoner objects or ids of summoners
 @param optional [Hash<Symbol, String>] optional arguments: :region => replaces default region
 @return [Hash<Integer, Runebook>] A hash mapping runebooks to the ids of summoners
returns the runebook for multiple summoners