Class: Lol::SummonerRequest
- Defined in:
- lib/lol/summoner_request.rb
Instance Attribute Summary
Attributes inherited from Request
Class Method Summary collapse
-
.api_version ⇒ String
Returns the supported API Version.
Instance Method Summary collapse
-
#by_name(*names) ⇒ Array
Looks for a summoner name and returns the associated summoner.
-
#get(*summoner_ids) ⇒ Array
Get a list of summoners by summoner ID.
-
#masteries(*summoner_ids) ⇒ Array
Get mastery pages by summoner ID.
-
#name(*summoner_ids) ⇒ Hash
Get list of summoner names by summoner IDs.
-
#runes(*summoner_ids) ⇒ Array
Get rune pages by summoner ID.
Methods inherited from Request
#api_url, #initialize, #perform_request
Constructor Details
This class inherits a constructor from Lol::Request
Class Method Details
.api_version ⇒ String
Returns the supported API Version
5 6 7 |
# File 'lib/lol/summoner_request.rb', line 5 def self.api_version "v1.3" end |
Instance Method Details
#by_name(*names) ⇒ Array
Looks for a summoner name and returns the associated summoner
12 13 14 15 16 |
# File 'lib/lol/summoner_request.rb', line 12 def by_name *names perform_request(api_url("summoner/by-name/#{names.join(",")}")).map do |key, data| Summoner.new data end end |
#get(*summoner_ids) ⇒ Array
Get a list of summoners by summoner ID
28 29 30 31 32 |
# File 'lib/lol/summoner_request.rb', line 28 def get *summoner_ids perform_request(api_url("summoner/#{summoner_ids.join(",")}")).map do |key, data| Summoner.new data end end |
#masteries(*summoner_ids) ⇒ Array
Get mastery pages by summoner ID
44 45 46 |
# File 'lib/lol/summoner_request.rb', line 44 def masteries *summoner_ids extract_pages MasteryPage, "masteries", summoner_ids end |
#name(*summoner_ids) ⇒ Hash
Get list of summoner names by summoner IDs
21 22 23 |
# File 'lib/lol/summoner_request.rb', line 21 def name *summoner_ids perform_request(api_url("summoner/#{summoner_ids.join(",")}/name")) end |
#runes(*summoner_ids) ⇒ Array
Get rune pages by summoner ID
37 38 39 |
# File 'lib/lol/summoner_request.rb', line 37 def runes *summoner_ids extract_pages RunePage, "runes", summoner_ids end |