Class: Lol::SummonerRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/lol/summoner_request.rb

Overview

Bindings for the Summoner API.

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

Instance Attribute Summary

Attributes inherited from Request

#api_key, #cache_store, #rate_limiter, #region

Instance Method Summary collapse

Methods inherited from Request

#api_base_url, #api_query_string, #api_url, api_version, #api_version, #cached?, #clean_url, #initialize, #perform_rate_limited_request, #perform_request, #perform_uncached_request, #platform, platforms, #store, #ttl

Constructor Details

This class inherits a constructor from Lol::Request

Instance Method Details

#find(id) ⇒ DynamicModel

Get a summoner by summoner ID.

Parameters:

  • id (Integer)

    Summoner ID

Returns:


14
15
16
# 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) ⇒ DynamicModel

Get a summoner by account ID.

Parameters:

  • account_id (Integer)

    Account ID

Returns:


29
30
31
# File 'lib/lol/summoner_request.rb', line 29

def  
  DynamicModel.new perform_request api_url "summoners/by-account/#{}"
end

#find_by_name(name) ⇒ DynamicModel

Get a summoner by summoner name.

Parameters:

  • name (String)

    Summoner name

Returns:


21
22
23
24
# 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