taric 1.0.0.pre.alpha.4 → 1.0.0.pre.alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d46901e8836cc9bc74e48dbc65e7381739dad92
4
- data.tar.gz: 21c61793d9993b3e8620276a8547aaa4ec77a0e1
3
+ metadata.gz: 4eef666e527bbd7f7ee31609391736be3da2fe9e
4
+ data.tar.gz: 574f397f268905572470a603f094d805d66bc5cc
5
5
  SHA512:
6
- metadata.gz: b5177e7f082635a7f15b65c0f08618000da845911b2bcc168d8ec270f8648df2ce62712e2606245b6ffd513b777a7c1bcbbf8a1d04709d941ec2955c66c239f9
7
- data.tar.gz: 1057062fd80b613b8e6b245d284ab0cce8f1114d1a8d46f6798473593328ab1c8a63bc1eeaf4e56162ff94df07c855ee07c3af2ef4642a1909fd9672a8cc0129
6
+ metadata.gz: 933bf43a54800e704bcef682e66048eca23fa5038acdc8244782023b3649ee28dd6995c3e7280e4c49b71afa1e0dc87e8e69eb900b3e2e0258600447224c0130
7
+ data.tar.gz: c3cd15b1bf70cb2072e3174a043808e4b34f34c2d6a8a4c6c0872681000e293fe191881b41147702db37d4b43cf778d7ef7916929f78aec69a1f582570cf5aad
data/README.md CHANGED
@@ -43,8 +43,8 @@ Or install it yourself as:
43
43
  - [x] LEAGUE-V2.5
44
44
  - [x] LOL-STATUS-V3
45
45
  - [x] MASTERIES-V3
46
- - [ ] MATCH-V3
47
- - [ ] RUNES-V3
46
+ - [x] MATCH-V3
47
+ - [x] RUNES-V3
48
48
  - [ ] SPECTATOR-V3
49
49
  - [ ] STATIC-DATA-V3
50
50
  - [x] SUMMONER-V3
data/lib/taric/client.rb CHANGED
@@ -73,7 +73,9 @@ module Taric
73
73
  # @example
74
74
  # Taric::Client.expand_template(api_key: 'ritokey', region: :na, operation: Taric::Operation::Champion::CHAMPIONS)
75
75
  def expand_template(api_key:, region:, operation:, options: {})
76
- operation.expand(options.merge(operation_values(api_key: api_key, region: region)))
76
+ result = operation.expand(options.merge(operation_values(api_key: api_key, region: region)))
77
+ puts result
78
+ result
77
79
  end
78
80
  end
79
81
 
@@ -4,7 +4,8 @@ module Taric
4
4
  module Connection
5
5
  def connection(config)
6
6
  options = {
7
- :headers => {'Accept' => "application/#{config.format}; charset=utf-8", 'User-Agent' => config.user_agent}
7
+ request: {:params_encoder => Faraday::FlatParamsEncoder },
8
+ headers: {'Accept' => "application/#{config.format}; charset=utf-8", 'User-Agent' => config.user_agent}
8
9
  }.merge(config.connection_opts)
9
10
 
10
11
  Faraday::Connection.new(options) do |conn|
@@ -8,7 +8,7 @@ require_relative 'lol_static_data'
8
8
  require_relative 'lol_status'
9
9
  require_relative 'masteries'
10
10
  require_relative 'match'
11
- require_relative 'match_list'
11
+ require_relative 'runes'
12
12
  require_relative 'stats'
13
13
  require_relative 'summoner'
14
14
  require_relative 'team'
@@ -28,7 +28,7 @@ module Taric
28
28
  include Taric::Operation::LolStatus
29
29
  include Taric::Operation::Masteries
30
30
  include Taric::Operation::Match
31
- include Taric::Operation::MatchList
31
+ include Taric::Operation::Runes
32
32
  include Taric::Operation::Stats
33
33
  include Taric::Operation::Summoner
34
34
  include Taric::Operation::Team
@@ -5,35 +5,60 @@ module Taric
5
5
  module Match
6
6
  include Taric::Operation::Base
7
7
 
8
- MATCH_VERSION = 'v2.2'
9
- MATCH = EndpointTemplate.new(template_url: "#{BASE_URL_FN.(MATCH_VERSION)}/match/{matchId}{?api_key,includeTimeline}")
10
- MATCH_IDS_BY_TOURNAMENT = EndpointTemplate.new(template_url: "#{BASE_URL_FN.(MATCH_VERSION)}/match/by-tournament/{tournamentCode}/ids{?api_key}")
11
- MATCH_FOR_TOURNAMENT = EndpointTemplate.new(template_url: "#{BASE_URL_FN.(MATCH_VERSION)}/match/for-tournament/{matchId}{?api_key,tournamentCode,includeTimeline}")
8
+ MATCH_V3 = EndpointTemplate.new(template_url: 'https://{host}/lol/match/v3/matches/{matchId}{?api_key}')
9
+ MATCHLIST_V3 = EndpointTemplate.new(template_url: 'https://{host}/lol/match/v3/matchlists/by-account/{accountId}{?api_key,beginTime,endIndex,season*,champion*,beginIndex,queue*,endTime}')
10
+ MATCHLIST_RECENT_V3 = EndpointTemplate.new(template_url: 'https://{host}/lol/match/v3/matchlists/by-account/{accountId}/recent{?api_key}')
12
11
 
13
12
  # Match data for id.
14
13
  #
15
- # @see https://developer.riotgames.com/api/methods#!/1027/3483
14
+ # @see https://developer.riotgames.com/api-methods/#match-v3/GET_getMatch
16
15
  # @param match_id [Fixnum] id of match
17
- # @param include_timeline [Boolean] optional, true includes timestamps on events
18
16
  # @return match data for id.
19
- def match(match_id:, include_timeline: nil)
20
- response_for MATCH, {matchId: match_id, includeTimeline: include_timeline}
17
+ def match(match_id: )
18
+ response_for MATCH_V3, {matchId: match_id}
21
19
  end
22
20
 
23
- # Retrieve match IDs by tournament code.
24
- # @param tournament_code [String] tournament code
25
- # @return match ids by tournament code
26
- def match_ids_by_tournament(tournament_code: )
27
- response_for MATCH_IDS_BY_TOURNAMENT, tournamentCode: tournament_code
21
+ # Matchlist data
22
+ #
23
+ # @see https://developer.riotgames.com/api-methods/#match-v3/GET_getMatchlist
24
+ # @param account_id [Fixnum] player's account ID
25
+ # @param champion [Fixnum, Array<Fixnum>] Optional - Set of champion IDs for which to filtering matchlist.
26
+ # @param queue [Fixnum, Array<Fixnum>] Optional - Set of queue IDs for which to filtering matchlist.
27
+ # @param season [Fixnum, Array<Fixnum>] Optional - Set of season IDs for which to filtering matchlist.
28
+ # @param begin_time [Fixnum] Optional - The begin time to use for filtering matchlist specified as epoch milliseconds.
29
+ # @param end_time [Fixnum] Optional - The end time to use for filtering matchlist specified as epoch milliseconds.
30
+ # @param begin_index [Fixnum] Optional - The begin index to use for filtering matchlist.
31
+ # @param end_index [Fixnum] Optional - The end index to use for filtering matchlist.
32
+ # @return [Response] list of match data
33
+ #
34
+ # @example filtering on single season and single champion
35
+ # client.matchlist(account_id: 47910, season: 7, champion: 113).body
36
+ #
37
+ # @example filtering on multiple seasons and champions
38
+ # client.matchlist(account_id: 47910, season: [6,7,8], champion: [16,37]).body
39
+ def matchlist(account_id:, begin_time: nil, end_index: nil, season: nil, champion: nil, begin_index: nil, queue: nil, end_time: nil)
40
+ response_for(
41
+ MATCHLIST_V3,
42
+ {
43
+ accountId: account_id,
44
+ beginTime: begin_time,
45
+ endIndex: end_index,
46
+ season: season,
47
+ champion: champion,
48
+ beginIndex: begin_index,
49
+ queue: queue,
50
+ endTime: end_time
51
+ }
52
+ )
28
53
  end
29
54
 
30
- # Retrieve match by match ID and tournament code.
31
- # @param match_id [Fixnum] id of match
32
- # @param tournament_code [String] tournament code
33
- # @param include_timeline [Boolean] optional, true includes timestamps on events
34
- # @return match ids by tournament code
35
- def match_for_tournament(match_id:, tournament_code:, include_timeline: false)
36
- response_for MATCH_IDS_BY_TOURNAMENT, tournamentCode: tournament_code, matchId: match_id, includeTimeline: include_timeline
55
+ # Matchlist data for the past 20 matches
56
+ #
57
+ # @see https://developer.riotgames.com/api-methods/#match-v3/GET_getRecentMatchlist
58
+ # @param account_id [Fixnum] player's account ID
59
+ # @return [Response] list of last 20 matches
60
+ def matchlist_recent(account_id: )
61
+ response_for MATCHLIST_RECENT_V3, {accountId: account_id}
37
62
  end
38
63
 
39
64
  end
@@ -0,0 +1,17 @@
1
+ require_relative 'endpoint_template'
2
+ module Taric
3
+ module Operation
4
+ module Runes
5
+
6
+ RUNES_V3 = EndpointTemplate.new(template_url: "https://{host}/lol/platform/v3/runes/by-summoner/{summonerId}{?api_key}")
7
+
8
+ # Runes by summoner ID.
9
+ #
10
+ # @param summoner_id [Fixnum] Summoner ID
11
+ # @return [Hash] runes for Summoner ID
12
+ def runes(summoner_id: )
13
+ response_for RUNES_V3, {summonerId: summoner_id}
14
+ end
15
+ end
16
+ end
17
+ end
@@ -5,17 +5,6 @@ module Taric
5
5
  module Summoner
6
6
  include Taric::Operation::Base
7
7
 
8
- RUNES_AND_MASTERIES_BASE = "https://{host}/api/lol/{region}/v1.4/summoner/{summonerIds}"
9
- RUNES = EndpointTemplate.new(template_url: "#{RUNES_AND_MASTERIES_BASE}/runes{?api_key}")
10
-
11
- # Runes keyed by summoner ID.
12
- #
13
- # @param summoner_ids [String] comma separated list of Summoner IDs
14
- # @return [Hash] runes by Summoner ID
15
- def summoner_runes(summoner_ids:)
16
- response_for RUNES, {summonerIds: summoner_ids}
17
- end
18
-
19
8
  BASE_SUMMONER_URL = "https://{host}/lol/summoner/v3/summoners"
20
9
  SUMMONER_BY_ID = EndpointTemplate.new(template_url: "#{BASE_SUMMONER_URL}/{summonerId}{?api_key}")
21
10
  SUMMONER_BY_NAME = EndpointTemplate.new(template_url: "#{BASE_SUMMONER_URL}/by-name/{summonerName}{?api_key}")
data/lib/taric/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Taric
2
- VERSION = '1.0.0-alpha.4'
2
+ VERSION = '1.0.0-alpha.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taric
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.alpha.4
4
+ version: 1.0.0.pre.alpha.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Yi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-29 00:00:00.000000000 Z
11
+ date: 2017-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -236,7 +236,7 @@ files:
236
236
  - lib/taric/operation/lol_status.rb
237
237
  - lib/taric/operation/masteries.rb
238
238
  - lib/taric/operation/match.rb
239
- - lib/taric/operation/match_list.rb
239
+ - lib/taric/operation/runes.rb
240
240
  - lib/taric/operation/stats.rb
241
241
  - lib/taric/operation/summoner.rb
242
242
  - lib/taric/operation/team.rb
@@ -1,27 +0,0 @@
1
- require_relative 'base'
2
- require_relative 'endpoint_template'
3
- module Taric
4
- module Operation
5
- module MatchList
6
- include Taric::Operation::Base
7
-
8
- MATCH_LIST_VERSION = 'v2.2'.freeze
9
- MATCH_LIST = EndpointTemplate.new(template_url: "#{BASE_URL_FN.(MATCH_LIST_VERSION)}/matchlist/by-summoner/{summonerId}{?api_key,championIds,rankedQueues,seasons,beginTime,endTime,beginIndex,endIndex}")
10
-
11
- # Returns match list for summoner.
12
- #
13
- # @see https://developer.riotgames.com/api/methods#!/1026/3480
14
- # @param summoner_id [Fixnum] summoner Id
15
- # @param champion_ids [String] Optional - Comma-separated list of champion IDs to use for fetching games.
16
- # @param ranked_queues [String] Optional - Comma-separated list of ranked queue types to use for fetching games. Non-ranked queue types will be ignored.
17
- # @param seasons [String] Optional - Comma-separated list of seasons to use for fetching games.
18
- # @param begin_time [Fixnum or Time] Optional - The begin time to use for fetching games.
19
- # @param end_time [Fixnum or Time] Optional - The end time to use for fetching games.
20
- def match_list(summoner_id:, champion_ids: nil, ranked_queues: nil, seasons: nil, begin_time: nil, end_time: nil, begin_index: nil, end_index: nil)
21
- response_for MATCH_LIST,
22
- {summonerId: summoner_id, championIds: champion_ids, rankedQueues: ranked_queues, seasons: seasons, beginTime: epoch_milliseconds(begin_time), endTime: epoch_milliseconds(end_time), beginIndex: begin_index, endIndex: end_index}
23
- end
24
-
25
- end
26
- end
27
- end