Class: Starcall::Endpoints::ChampionMasteryV4

Inherits:
Object
  • Object
show all
Defined in:
lib/starcall/endpoints/champion_mastery_v4.rb

Overview

Methods used to call the Champion Mastery endpoints.

Class Method Summary collapse

Class Method Details

.summoner(encrypted_summoner_id:, region:) ⇒ Object

Get all champion mastery entries sorted by number of champion points descending.



11
12
13
14
15
16
17
# File 'lib/starcall/endpoints/champion_mastery_v4.rb', line 11

def self.summoner(encrypted_summoner_id:, region:)
  Starcall::Regions.valid?(region: region)
  Starcall::ApiRequests.make_request(
    url: "https://#{parse_region(region: region)}.api.riotgames.com"\
         "/lol/champion-mastery/v4/champion-masteries/by-summoner/#{encrypted_summoner_id}"
  )
end

.summoner_on_champion(encrypted_summoner_id:, champion_id:, region:) ⇒ Object

Get a champion mastery by player ID and champion ID.



20
21
22
23
24
25
26
27
# File 'lib/starcall/endpoints/champion_mastery_v4.rb', line 20

def self.summoner_on_champion(encrypted_summoner_id:, champion_id:, region:)
  Starcall::Regions.valid?(region: region)
  Starcall::ApiRequests.make_request(
    url: "https://#{parse_region(region: region)}.api.riotgames.com"\
         "/lol/champion-mastery/v4/champion-masteries/by-summoner/#{encrypted_summoner_id}"\
         "/by-champion/#{champion_id}"
  )
end

.summoner_total_mastery(encrypted_summoner_id:, region:) ⇒ Object

Get a player’s total champion mastery score, which is the sum of individual champion mastery levels.



30
31
32
33
34
35
36
# File 'lib/starcall/endpoints/champion_mastery_v4.rb', line 30

def self.summoner_total_mastery(encrypted_summoner_id:, region:)
  Starcall::Regions.valid?(region: region)
  Starcall::ApiRequests.make_request(
    url: "https://#{parse_region(region: region)}.api.riotgames.com"\
         "/lol/champion-mastery/v4/scores/by-summoner/#{encrypted_summoner_id}"
  )
end