Class: Ryze::MatchResource
- Defined in:
- lib/Ryze/resources/match.rb
Overview
MatchResource is a class corresponding to the MatchV5 Riot API endpoint.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(client) ⇒ MatchResource
constructor
A new instance of MatchResource.
-
#retrieve_match(match_id:) ⇒ Match
Retrieve a match by match ID.
-
#retrieve_match_list_by_puuid(puuid:, **params) ⇒ Array<String>
Retrieve a match list by account puuid.
Constructor Details
#initialize(client) ⇒ MatchResource
Returns a new instance of MatchResource.
6 7 8 9 |
# File 'lib/Ryze/resources/match.rb', line 6 def initialize(client) super @base_url = "https://europe.api.riotgames.com/lol/match/v5" end |
Instance Method Details
#retrieve_match(match_id:) ⇒ Match
Retrieve a match by match ID.
15 16 17 |
# File 'lib/Ryze/resources/match.rb', line 15 def retrieve_match(match_id:) Match.new get_request("/matches/#{match_id}").body end |
#retrieve_match_list_by_puuid(puuid:, **params) ⇒ Array<String>
Retrieve a match list by account puuid.
24 25 26 |
# File 'lib/Ryze/resources/match.rb', line 24 def retrieve_match_list_by_puuid(puuid:, **params) Array.new get_request("/matches/by-puuid/#{puuid}/ids", params: params).body end |