Class: Starcall::Endpoints::SpectatorV4

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

Overview

Methods for getting spectator information

Class Method Summary collapse

Class Method Details

Get list of featured games



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

def self.featured_games(region: 'euw')
  Starcall::Regions.valid?(region: region)
  Starcall::ApiRequests.make_request(
    url: "https://#{parse_region(region: region)}.api.riotgames.com"\
         '/lol/spectator/v4/featured-games'
  )
end

.summoner_game_info(encrypted_summoner_id:, region:) ⇒ Object

Get current game information for the given summoner ID



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

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