Class: Ryze::SummonerResource
- Defined in:
- lib/Ryze/resources/summoner.rb
Overview
SummonerResource is a class corresponding to the SummonerV4 Riot API endpoint.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(client) ⇒ SummonerResource
constructor
A new instance of SummonerResource.
-
#retrieve_summoner_by_account_id(account_id:) ⇒ Summoner
Retrieve a summoner by summoner account ID.
-
#retrieve_summoner_by_name(summoner_name:) ⇒ Summoner
Retrieve a summoner by summoner name.
-
#retrieve_summoner_by_puuid(puuid:) ⇒ Summoner
Retrieve a summoner by summoner puuid.
-
#retrieve_summoner_by_summoner_id(summoner_id:) ⇒ Summoner
Retrieve a summoner by summoner ID.
Constructor Details
#initialize(client) ⇒ SummonerResource
Returns a new instance of SummonerResource.
6 7 8 9 |
# File 'lib/Ryze/resources/summoner.rb', line 6 def initialize(client) super @base_url = "https://euw1.api.riotgames.com/lol/summoner/v4" end |
Instance Method Details
#retrieve_summoner_by_account_id(account_id:) ⇒ Summoner
Retrieve a summoner by summoner account ID.
31 32 33 |
# File 'lib/Ryze/resources/summoner.rb', line 31 def retrieve_summoner_by_account_id(account_id:) Summoner.new get_request("/summoners/by-account/#{account_id}").body, @client end |
#retrieve_summoner_by_name(summoner_name:) ⇒ Summoner
Retrieve a summoner by summoner name.
15 16 17 |
# File 'lib/Ryze/resources/summoner.rb', line 15 def retrieve_summoner_by_name(summoner_name:) Summoner.new get_request("/summoners/by-name/#{summoner_name}").body, @client end |