-
Notifications
You must be signed in to change notification settings - Fork 9
/
stats.rb
34 lines (31 loc) · 1.24 KB
/
stats.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require_relative 'base'
require_relative 'endpoint_template'
module Taric
module Operation
module Stats
include Taric::Operation::Base
STATS_VERSION = 'v1.3'.freeze
BASE_STATS_URL = "#{BASE_URL_FN.(STATS_VERSION)}/stats/by-summoner/{summonerId}"
RANKED = EndpointTemplate.new(template_url: "#{BASE_STATS_URL}/ranked{?api_key,season}")
SUMMARY = EndpointTemplate.new(template_url: "#{BASE_STATS_URL}/summary{?api_key,season}")
# Ranked stats for summoner.
#
# @see https://developer.riotgames.com/api/methods#!/1018/3452
# @param summoner_id [Fixnum] ID of summoner
# @param season [String] Optional - valid season
# @return [Hash] ranked stats
def ranked_stats(summoner_id: , season: nil)
response_for RANKED, {summonerId: summoner_id, season: season}
end
# Summary stats for summoner.
#
# @see https://developer.riotgames.com/api/methods#!/1018/3453
# @param summoner_id [Fixnum] ID of summoner
# @param season [String] Optional - valid season
# @return [Hash] various aggregate stats
def summary_stats(summoner_id: , season: nil)
response_for SUMMARY, {summonerId: summoner_id, season: season}
end
end
end
end