Class: Lol::LeagueRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/lol/league_request.rb

Overview

Bindings for the League API.

See: developer.riotgames.com/api-methods/#league-v3

Instance Attribute Summary

Attributes inherited from Request

#api_key, #cache_store, #rate_limiter, #region

Instance Method Summary collapse

Methods inherited from Request

#api_base_url, #api_query_string, #api_url, api_version, #api_version, #cached?, #clean_url, #initialize, #perform_rate_limited_request, #perform_request, #perform_uncached_request, #platform, platforms, #store, #ttl

Constructor Details

This class inherits a constructor from Lol::Request

Instance Method Details

#find_challenger(queue: 'RANKED_SOLO_5x5') ⇒ DynamicModel

Get the challenger league for a given queue

Parameters:

  • queue (String) (defaults to: 'RANKED_SOLO_5x5')

    Queue identifier. See the list of game constants (developer.riotgames.com/game-constants.html) for the available queue identifiers

Returns:


14
15
16
# File 'lib/lol/league_request.rb', line 14

def find_challenger queue: 'RANKED_SOLO_5x5'
  DynamicModel.new perform_request api_url "challengerleagues/by-queue/#{queue}"
end

#find_master(queue: 'RANKED_SOLO_5x5') ⇒ DynamicModel

Get the master league for a given queue

Parameters:

  • queue (String) (defaults to: 'RANKED_SOLO_5x5')

    Queue identifier. See the list of game constants (developer.riotgames.com/game-constants.html) for the available queue identifiers

Returns:


21
22
23
# File 'lib/lol/league_request.rb', line 21

def find_master queue: 'RANKED_SOLO_5x5'
  DynamicModel.new perform_request api_url "masterleagues/by-queue/#{queue}"
end

#summoner_leagues(summoner_id:) ⇒ Array<DynamicModel>

Get leagues in all queues for a given summoner ID

Parameters:

  • summoner_id (Integer)

    Summoner ID associated with the player

Returns:

  • (Array<DynamicModel>)

    List of leagues summoner is participating in


28
29
30
31
# File 'lib/lol/league_request.rb', line 28

def summoner_leagues summoner_id:
  result = perform_request api_url "leagues/by-summoner/#{summoner_id}"
  result.map { |c| DynamicModel.new c }
end

#summoner_positions(summoner_id:) ⇒ Array<DynamicModel>

Get league positions in all queues for a given summoner ID

Parameters:

  • summoner_id (Integer)

    Summoner ID associated with the player

Returns:


36
37
38
39
# File 'lib/lol/league_request.rb', line 36

def summoner_positions summoner_id:
  result = perform_request api_url "positions/by-summoner/#{summoner_id}"
  result.map { |c| DynamicModel.new c }
end