class Lol::SummonerRequest

Bindings for the Summoner API.

See: developer.riotgames.com/api-methods/#summoner-v3

Public Instance Methods

api_base_path() click to toggle source

@!visibility private

# File lib/lol/summoner_request.rb, line 7
def api_base_path
  "/lol/summoner/#{self.class.api_version}"
end
find(id) click to toggle source

Get a summoner by summoner ID. @param [Integer] id Summoner ID @return [DynamicModel] Summoner representation

# File lib/lol/summoner_request.rb, line 14
def find id
  DynamicModel.new perform_request api_url "summoners/#{id}"
end
find_by_account_id(account_id) click to toggle source

Get a summoner by account ID. @param [Integer] account_id Account ID @return [DynamicModel] Summoner representation

# File lib/lol/summoner_request.rb, line 29
def find_by_account_id account_id
  DynamicModel.new perform_request api_url "summoners/by-account/#{account_id}"
end
find_by_name(name) click to toggle source

Get a summoner by summoner name. @param [String] name Summoner name @return [DynamicModel] Summoner representation

# File lib/lol/summoner_request.rb, line 21
def find_by_name name
  name = CGI.escape name.downcase.gsub(/\s/, '')
  DynamicModel.new perform_request api_url "summoners/by-name/#{name}"
end