Class: Lol::SummonerRequest
- Defined in:
- lib/lol/summoner_request.rb
Overview
Bindings for the Summoner API.
Instance Attribute Summary
Attributes inherited from Request
#api_key, #cache_store, #rate_limiter, #region
Instance Method Summary collapse
-
#find(id) ⇒ DynamicModel
Get a summoner by summoner ID.
-
#find_by_account_id(account_id) ⇒ DynamicModel
Get a summoner by account ID.
-
#find_by_name(name) ⇒ DynamicModel
Get a summoner by summoner name.
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.
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.
29 30 31 |
# 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) ⇒ DynamicModel
Get a summoner by summoner name.
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 |