taric 1.0.0.pre.alpha.8 → 1.0.0.pre.beta.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffd37d010ecf164b3839c7a6fa33ec7d0f6f3be6
4
- data.tar.gz: 2bc40a4a441fbe522b3333dd3c195b69be6ec2ec
3
+ metadata.gz: 44cd3b4600cd84b0ad5028a0efb5079f81b7d970
4
+ data.tar.gz: 1d69a03f5509088119d3aa362645c7ba4dff4c43
5
5
  SHA512:
6
- metadata.gz: 9f6e445721655023a322186208c87ef6f1c24330e2041c4f0b63d471dd1fde686be4cb0d5d720e0f38435d2f353059028562b18763bf22d4065f1f8022040cc1
7
- data.tar.gz: d7d215133cfb540093aae3f795ce1e1f4fd1e7d12bc21289caca528cef60dfc3ec6d82d9218a0e6bccd08ac467541332ec052fe87b9ea15d619437cd04131445
6
+ metadata.gz: 10c53039c913dbb5950ae1ad8fa9090f2e7e6d7a3e216ebdcfd53d704d858901c28e19cb244c98848f4399b8980f7645ce933fe5db0b46bbcabbe59d75e68eb3
7
+ data.tar.gz: 3f4d46480b99b87414d045541795ce4422164882df82d26cacdea7d1c8677eb8f7cefbebf7fc5c85b4d5e6d22af0f5dbbb1c4a548232c15c9475918e4b4b7807
@@ -7,10 +7,7 @@ require_relative 'masteries'
7
7
  require_relative 'match'
8
8
  require_relative 'runes'
9
9
  require_relative 'spectator'
10
- require_relative 'stats'
11
10
  require_relative 'summoner'
12
- require_relative 'team'
13
- require_relative 'tournament'
14
11
 
15
12
  # Combines operations of LoL API.
16
13
  module Taric
@@ -25,10 +22,7 @@ module Taric
25
22
  include Taric::Operation::Match
26
23
  include Taric::Operation::Runes
27
24
  include Taric::Operation::Spectator
28
- include Taric::Operation::Stats
29
25
  include Taric::Operation::Summoner
30
- include Taric::Operation::Team
31
- include Taric::Operation::Tournament
32
26
 
33
27
  # Template for requesting the url and processing the response.
34
28
  #
@@ -10,12 +10,10 @@ module Taric
10
10
 
11
11
  LEAGUES_BY_SUMMONER_IDS = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/by-summoner/{summonerIds}{?api_key}")
12
12
  ENTRIES_BY_SUMMONER_IDS = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/by-summoner/{summonerIds}/entry{?api_key}")
13
- LEAGUES_BY_TEAM_IDS = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/by-team/{teamIds}{?api_key}")
14
- ENTRIES_BY_TEAM_IDS = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/by-team/{teamIds}/entry{?api_key}")
15
13
  CHALLENGER = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/challenger{?api_key,type}")
16
14
  MASTER = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/master{?api_key,type}")
17
15
 
18
- CHALLENGER_QUEUE_TYPES = ['RANKED_SOLO_5x5'.freeze, 'RANKED_TEAM_3x3'.freeze, 'RANKED_TEAM_5x5'.freeze].freeze
16
+ CHALLENGER_QUEUE_TYPES = ['RANKED_FLEX_SR'.freeze, 'RANKED_FLEX_TT'.freeze, 'RANKED_SOLO_5x5'.freeze, 'RANKED_TEAM_3x3'.freeze, 'RANKED_TEAM_5x5'.freeze].freeze
19
17
  MASTER_QUEUE_TYPES = CHALLENGER_QUEUE_TYPES
20
18
 
21
19
  # Leagues by summoner IDs.
@@ -48,27 +46,9 @@ module Taric
48
46
  response_for ENTRIES_BY_SUMMONER_IDS, {summonerIds: summoner_ids}
49
47
  end
50
48
 
51
- # Leagues by team IDs.
52
- #
53
- # @see https://developer.riotgames.com/api/methods#!/985/3352
54
- # @param team_ids team_ids [String] comma separated list of team ids
55
- # @return [Hash] leagues keyed by team_ids
56
- def leagues_by_team_ids(team_ids:)
57
- response_for LEAGUES_BY_TEAM_IDS, {teamIds: team_ids}
58
- end
59
-
60
- # League entries by team IDs.
61
- #
62
- # @see https://developer.riotgames.com/api/methods#!/985/3355
63
- # @param team_ids team_ids [String] comma separated list of team ids
64
- # @return [Hash] league entries keyed by team_ids
65
- def league_entries_by_team_ids(team_ids:)
66
- response_for ENTRIES_BY_TEAM_IDS, {teamIds: team_ids}
67
- end
68
-
69
49
  # Challenger league data for queue type.
70
50
  #
71
- # @param type [String] required, must be RANKED_SOLO_5x5, RANKED_TEAM_3x3, or RANKED_TEAM_5x5
51
+ # @param type [String] required, must be RANKED_FLEX_SR, RANKED_FLEX_TT, RANKED_SOLO_5x5, RANKED_TEAM_3x3, or RANKED_TEAM_5x5
72
52
  # @return [Hash] challenger league data
73
53
  # @see https://developer.riotgames.com/api/methods#!/985/3353
74
54
  def challenger(type: )
@@ -80,7 +60,7 @@ module Taric
80
60
 
81
61
  # Master league data for queue type.
82
62
  #
83
- # @param type [String] required, must be RANKED_SOLO_5x5, RANKED_TEAM_3x3, or RANKED_TEAM_5x5
63
+ # @param type [String] required, must be RANKED_FLEX_SR, RANKED_FLEX_TT, RANKED_SOLO_5x5, RANKED_TEAM_3x3, or RANKED_TEAM_5x5
84
64
  # @return [Hash] master league data
85
65
  # https://developer.riotgames.com/api/methods#!/985/3354
86
66
  def master(type: )
@@ -42,13 +42,13 @@ module Taric
42
42
  MATCHLIST_V3,
43
43
  {
44
44
  accountId: account_id,
45
- beginTime: begin_time,
45
+ beginTime: epoch_milliseconds(begin_time),
46
46
  endIndex: end_index,
47
47
  season: season,
48
48
  champion: champion,
49
49
  beginIndex: begin_index,
50
50
  queue: queue,
51
- endTime: end_time
51
+ endTime: epoch_milliseconds(end_time)
52
52
  }
53
53
  )
54
54
  end
data/lib/taric/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Taric
2
- VERSION = '1.0.0-alpha.8'
2
+ VERSION = '1.0.0-beta.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taric
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.alpha.8
4
+ version: 1.0.0.pre.beta.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Yi
@@ -235,10 +235,7 @@ files:
235
235
  - lib/taric/operation/match.rb
236
236
  - lib/taric/operation/runes.rb
237
237
  - lib/taric/operation/spectator.rb
238
- - lib/taric/operation/stats.rb
239
238
  - lib/taric/operation/summoner.rb
240
- - lib/taric/operation/team.rb
241
- - lib/taric/operation/tournament.rb
242
239
  - lib/taric/version.rb
243
240
  - taric.gemspec
244
241
  homepage: http://github.com/josephyi/taric
@@ -1,34 +0,0 @@
1
- require_relative 'base'
2
- require_relative 'endpoint_template'
3
- module Taric
4
- module Operation
5
- module Stats
6
- include Taric::Operation::Base
7
-
8
- STATS_VERSION = 'v1.3'.freeze
9
- BASE_STATS_URL = "#{BASE_URL_FN.(STATS_VERSION)}/stats/by-summoner/{summonerId}"
10
- RANKED = EndpointTemplate.new(template_url: "#{BASE_STATS_URL}/ranked{?api_key,season}")
11
- SUMMARY = EndpointTemplate.new(template_url: "#{BASE_STATS_URL}/summary{?api_key,season}")
12
-
13
- # Ranked stats for summoner.
14
- #
15
- # @see https://developer.riotgames.com/api/methods#!/1018/3452
16
- # @param summoner_id [Fixnum] ID of summoner
17
- # @param season [String] Optional - valid season
18
- # @return [Hash] ranked stats
19
- def ranked_stats(summoner_id: , season: nil)
20
- response_for RANKED, {summonerId: summoner_id, season: season}
21
- end
22
-
23
- # Summary stats for summoner.
24
- #
25
- # @see https://developer.riotgames.com/api/methods#!/1018/3453
26
- # @param summoner_id [Fixnum] ID of summoner
27
- # @param season [String] Optional - valid season
28
- # @return [Hash] various aggregate stats
29
- def summary_stats(summoner_id: , season: nil)
30
- response_for SUMMARY, {summonerId: summoner_id, season: season}
31
- end
32
- end
33
- end
34
- end
@@ -1,34 +0,0 @@
1
- require_relative 'base'
2
- require_relative 'endpoint_template'
3
- module Taric
4
- module Operation
5
- module Team
6
- include Taric::Operation::Base
7
-
8
- TEAM_VERSION = 'v2.4'.freeze
9
- BASE_TEAM_URL = "#{BASE_URL_FN.(TEAM_VERSION)}/team"
10
-
11
- TEAMS_BY_SUMMONER_IDS = EndpointTemplate.new(template_url: "#{BASE_TEAM_URL}/by-summoner/{summonerIds}")
12
- TEAMS_BY_TEAM_IDS = EndpointTemplate.new(template_url: "#{BASE_TEAM_URL}/{teamIds}")
13
-
14
- # Teams by summoner ids.
15
- #
16
- # @param summoner_ids [String] comma separated list of summoner ids
17
- # @return [Hash] team info by summoner id
18
- # @see https://developer.riotgames.com/api/methods#!/986/3358
19
- def teams_by_summoner_ids(summoner_ids:)
20
- response_for TEAMS_BY_SUMMONER_IDS, {summonerIds: summoner_ids}
21
- end
22
-
23
- # Teams by team ids.
24
- #
25
- # @param team_ids [String] comma separated list of team ids
26
- # @return [Hash] team info by team IDs
27
- # @see https://developer.riotgames.com/api/methods#!/986/3357
28
- def teams(team_ids:)
29
- response_for TEAMS_BY_TEAM_IDS, {teamIds: team_ids}
30
- end
31
- end
32
- end
33
- end
34
-
@@ -1,57 +0,0 @@
1
- require_relative 'base'
2
- require_relative 'endpoint_template'
3
- require 'oj'
4
- module Taric
5
- module Operation
6
- module Tournament
7
- include Taric::Operation::Base
8
-
9
- TOURNAMENT_VERSION = 'v1'.freeze
10
- PROVIDER_URL = "https://global.api.pvp.net/tournament/public/#{TOURNAMENT_VERSION}/provider".freeze
11
- TOURNAMENT_URL = "https://global.api.pvp.net/tournament/public/#{TOURNAMENT_VERSION}/tournament".freeze
12
- CODE_URL = "https://global.api.pvp.net/tournament/public/#{TOURNAMENT_VERSION}/code{?tournamentId,count}".freeze
13
- TOURNAMENT_BY_CODE_URL = "https://global.api.pvp.net/tournament/public/#{TOURNAMENT_VERSION}/code/{tournamentCode}".freeze
14
- LOBBY_EVENTS_BY_CODE_URL = "https://global.api.pvp.net/tournament/public/#{TOURNAMENT_VERSION}/lobby/events/by-code/{tournamentCode}".freeze
15
-
16
-
17
- # Creates a tournament provider and returns its ID.
18
- #
19
- def create_provider(region:, url: )
20
- body = {'region'.freeze => region, 'url'.freeze => url}
21
- response_for EndpointTemplate.new(template_url: PROVIDER_URL, method: :post, headers: {'X-Riot-Token'.freeze => @api_key, 'Content-Type'.freeze => 'application/json'}, body: Oj.dump(body))
22
- end
23
-
24
- # Creates a tournament and returns its ID.
25
- #
26
- def create_tournament(name: '', provider_id: )
27
- body = {'name'.freeze => name, 'providerId'.freeze => provider_id}
28
- response_for EndpointTemplate.new(template_url: TOURNAMENT_URL, method: :post, headers: {'X-Riot-Token'.freeze => @api_key, 'Content-Type'.freeze => 'application/json'}, body: Oj.dump(body))
29
- end
30
-
31
- # Create a tournament code for the given tournament.
32
- def create_tournament_codes(tournament_id: , count:, allowed_summoner_ids: [], map_type:, metadata: nil, pick_type:, spectator_type:, team_size: )
33
- body = {'mapType'.freeze => map_type, 'teamSize'.freeze => team_size, 'pickType'.freeze => pick_type, 'spectatorType'.freeze => spectator_type}
34
- body.merge!('metadata'.freeze => metadata) unless metadata.nil?
35
- body.merge!('allowed_summoner_ids'.freeze => {'participants'.freeze => allowed_summoner_ids}) unless allowed_summoner_ids.empty?
36
- response_for(EndpointTemplate.new(template_url: CODE_URL, method: :post, headers: {'X-Riot-Token'.freeze => @api_key, 'Content-Type'.freeze => 'application/json'.freeze},
37
- body: Oj.dump(body)), tournamentId: tournament_id, count: count)
38
- end
39
-
40
-
41
- def tournament_by_code(tournament_code: )
42
- response_for EndpointTemplate.new(template_url: TOURNAMENT_BY_CODE_URL, headers: {'X-Riot-Token'.freeze => @api_key}), tournamentCode: tournament_code
43
- end
44
-
45
- # Update the pick type, map, spectator type, or allowed summoners for a code
46
- def update_tournament(tournament_code:, allowed_participants: nil, spectator_type: nil, pick_type: nil, map_type: nil)
47
- body = {'spectatorType'.freeze => spectator_type, 'pickType'.freeze => pick_type, 'mapType'.freeze => map_type, 'allowedParticipants'.freeze => allowed_participants}.select!{ |_, v| !v.nil? }
48
- response_for EndpointTemplate.new(template_url: TOURNAMENT_BY_CODE_URL, headers: {'X-Riot-Token'.freeze => @api_key, 'Content-Type'.freeze => 'application/json'.freeze},
49
- body: Oj.dump(body), method: :put), tournamentCode: tournament_code
50
- end
51
-
52
- def lobby_events_by_code(tournament_code: )
53
- response_for EndpointTemplate.new(template_url: LOBBY_EVENTS_BY_CODE_URL, headers: {'X-Riot-Token'.freeze => @api_key, 'Content-Type'.freeze => 'application/json'.freeze}), tournamentCode: tournament_code
54
- end
55
- end
56
- end
57
- end