Class: Lol::MatchRequest

Inherits:
Request show all
Defined in:
lib/lol/match_request.rb

Overview

Bindings for the Match API.

See: developer.riotgames.com/api-methods/#match-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

#all(options = {}, account_id:) ⇒ DynamicModel

Get matchlist for ranked games played on given account ID and platform ID and filtered using given filter parameters, if any.

Parameters:

  • account_id (Integer)

    Account ID

  • options (Hash) (defaults to: {})

    the options to pass to the call

Options Hash (options):

  • queue (Array<Integer>)

    Set of queue IDs for which to filtering matchlist.

  • beginTime (Integer)

    The begin time to use for filtering matchlist specified as epoch milliseconds.

  • endTime (Integer)

    The end time to use for filtering matchlist specified as epoch milliseconds.

  • beginIndex (Integer)

    The begin index to use for filtering matchlist.

  • endIndex (Integer)

    The end index to use for filtering matchlist.

  • season (Array<Integer>)

    Set of season IDs for which to filtering matchlist.

  • champion (Array<Integer>)

    Set of champion IDs for which to filtering matchlist.

Returns:


53
54
55
# File 'lib/lol/match_request.rb', line 53

def all options={}, account_id:
  DynamicModel.new perform_request api_url "matchlists/by-account/#{account_id}", options
end

#find(options = {}, match_id:) ⇒ DynamicModel

Get match by match ID.

Parameters:

  • match_id (Integer)

    Match ID

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • forAccountId (Integer)

    Optional used to identify the participant to be unobfuscated

  • forPlatformId (Integer)

    Optional used to identify the participant to be unobfuscated (for when user have changed regions)

Returns:


16
17
18
# File 'lib/lol/match_request.rb', line 16

def find options={}, match_id:
  DynamicModel.new perform_request api_url "matches/#{match_id}", options
end

#find_by_tournament(match_id, tournament_code) ⇒ DynamicModel

Get match by match ID and tournament code.

Parameters:

  • match_id (Integer)

    Match ID

  • tournament_code (String)

    Tournament code the match belongs to

Returns:


38
39
40
# File 'lib/lol/match_request.rb', line 38

def find_by_tournament match_id, tournament_code
  DynamicModel.new perform_request api_url "matches/#{match_id}/by-tournament-code/#{tournament_code}"
end

#find_timeline(match_id) ⇒ DynamicModel

Get match timeline by match ID.

Parameters:

  • match_id (Integer)

    Match ID

Returns:


23
24
25
# File 'lib/lol/match_request.rb', line 23

def find_timeline match_id
  DynamicModel.new perform_request api_url "timelines/by-match/#{match_id}"
end

#ids_by_tournament_code(tournament_code) ⇒ Array<Integer>

Get match IDs by tournament code.

Parameters:

  • tournament_code (String)

    Tournament code

Returns:

  • (Array<Integer>)

    List of match IDs


30
31
32
# File 'lib/lol/match_request.rb', line 30

def ids_by_tournament_code tournament_code
  perform_request api_url "matches/by-tournament-code/#{tournament_code}/ids"
end

#recent(account_id:) ⇒ DynamicModel

Get matchlist for last 20 matches played on given account ID and platform ID.

Parameters:

  • account_id (Integer)

    Account ID

Returns:


60
61
62
# File 'lib/lol/match_request.rb', line 60

def recent account_id:
  DynamicModel.new perform_request api_url "matchlists/by-account/#{account_id}/recent"
end