Class: Ryze::SummonerResource

Inherits:
Resource
  • Object
show all
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

#client

Instance Method Summary collapse

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.

Parameters:

  • account_id (String)

    Summoner account ID.

Returns:



31
32
33
# File 'lib/Ryze/resources/summoner.rb', line 31

def (account_id:)
  Summoner.new get_request("/summoners/by-account/#{}").body, @client
end

#retrieve_summoner_by_name(summoner_name:) ⇒ Summoner

Retrieve a summoner by summoner name.

Parameters:

  • summoner_name (String)

    Summoner name.

Returns:



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

#retrieve_summoner_by_puuid(puuid:) ⇒ Summoner

Retrieve a summoner by summoner puuid.

Parameters:

  • puuid (String)

    Summoner puuid.

Returns:



23
24
25
# File 'lib/Ryze/resources/summoner.rb', line 23

def retrieve_summoner_by_puuid(puuid:)
  Summoner.new get_request("/summoners/by-puuid/#{puuid}").body, @client
end

#retrieve_summoner_by_summoner_id(summoner_id:) ⇒ Summoner

Retrieve a summoner by summoner ID.

Parameters:

  • summoner_id (String)

    Summoner ID.

Returns:



39
40
41
# File 'lib/Ryze/resources/summoner.rb', line 39

def retrieve_summoner_by_summoner_id(summoner_id:)
  Summoner.new get_request("/summoners/#{summoner_id}").body, @client
end