Class: Ryze::MatchResource

Inherits:
Resource show all
Defined in:
lib/Ryze/resources/match.rb

Overview

MatchResource is a class corresponding to the MatchV5 Riot API endpoint.

Constant Summary collapse

BASE_URL =
"https://europe.api.riotgames.com/lol/match/v5"

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Ryze::Resource

Instance Method Details

#retrieve_match(match_id:) ⇒ Match

Retrieve a match by match ID.

Parameters:

  • match_id (String)

    Match ID.

Returns:

  • (Match)

    Match object.



12
13
14
# File 'lib/Ryze/resources/match.rb', line 12

def retrieve_match(match_id:)
  Match.new get_request("#{BASE_URL}/matches/#{match_id}").body
end

#retrieve_match_list_by_puuid(puuid:, **params) ⇒ Array<String>

Retrieve a match list by account puuid.

Parameters:

  • puuid (String)

    Account puuid.

  • params (Hash)

    Parameters to pass to the request.

Returns:

  • (Array<String>)

    Match IDs.



21
22
23
# File 'lib/Ryze/resources/match.rb', line 21

def retrieve_match_list_by_puuid(puuid:, **params)
  Array.new get_request("#{BASE_URL}/matches/by-puuid/#{puuid}/ids", params: params).body
end