Class: Starcall::Endpoints::ClashV1

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

Overview

Methods used to get information about clash

Class Method Summary collapse

Class Method Details

.clash_by_summoner_id(encrypted_summoner_id:, region:) ⇒ Object

Get players by summoner ID.



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

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

.clash_by_team_id(team_id:, region:) ⇒ Object

Get team by ID.



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

def self.clash_by_team_id(team_id:, region:)
  Starcall::Regions.valid?(region: region)
  Starcall::ApiRequests.make_request(
    url: "https://#{parse_region(region: region)}.api.riotgames.com"\
         "/lol/clash/v1/teams/#{team_id}"
  )
end

.clash_tournaments(region:) ⇒ Object

Get all active or upcoming tournaments.



29
30
31
32
33
34
# File 'lib/starcall/endpoints/clash_v1.rb', line 29

def self.clash_tournaments(region:)
  Starcall::Regions.valid?(region: region)
  Starcall::ApiRequests.make_request(
    url: "https://#{parse_region(region: region)}.api.riotgames.com/lol/clash/v1/tournaments"
  )
end

.clash_tournaments_by_team_id(team_id:, region:) ⇒ Object

Get tournament by team ID.



37
38
39
40
41
42
43
# File 'lib/starcall/endpoints/clash_v1.rb', line 37

def self.clash_tournaments_by_team_id(team_id:, region:)
  Starcall::Regions.valid?(region: region)
  Starcall::ApiRequests.make_request(
    url: "https://#{parse_region(region: region)}.api.riotgames.com"\
         "/lol/clash/v1/tournaments/by-team/#{team_id}"
  )
end

.clash_tournaments_by_tournament_id(tournament_id:, region:) ⇒ Object

Get tournament by ID



46
47
48
49
50
51
52
# File 'lib/starcall/endpoints/clash_v1.rb', line 46

def self.clash_tournaments_by_tournament_id(tournament_id:, region:)
  Starcall::Regions.valid?(region: region)
  Starcall::ApiRequests.make_request(
    url: "https://#{parse_region(region: region)}.api.riotgames.com"\
         "/lol/clash/v1/tournaments/#{tournament_id}"
  )
end