blizzard_api 0.5.6 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +6 -2
- data/blizzard_api.gemspec +2 -1
- data/lib/blizzard_api/configuration.rb +10 -34
- data/lib/blizzard_api/diablo/community/act.rb +2 -2
- data/lib/blizzard_api/diablo/community/artisan.rb +2 -2
- data/lib/blizzard_api/diablo/community/character.rb +2 -2
- data/lib/blizzard_api/diablo/community/follower.rb +1 -1
- data/lib/blizzard_api/diablo/community/item.rb +1 -1
- data/lib/blizzard_api/diablo/community/item_type.rb +2 -2
- data/lib/blizzard_api/diablo/game_data/generic_data_endpoint.rb +3 -3
- data/lib/blizzard_api/hearthstone/game_data/back.rb +1 -1
- data/lib/blizzard_api/hearthstone/game_data/card.rb +2 -2
- data/lib/blizzard_api/hearthstone/game_data/generic_data_endpoint.rb +2 -2
- data/lib/blizzard_api/request.rb +5 -4
- data/lib/blizzard_api/starcraft/community/ladder.rb +2 -2
- data/lib/blizzard_api/starcraft/community/profile.rb +5 -5
- data/lib/blizzard_api/starcraft/game_data/league.rb +1 -1
- data/lib/blizzard_api/version.rb +1 -1
- data/lib/blizzard_api/wow/game_data/achievement.rb +3 -3
- data/lib/blizzard_api/wow/game_data/auction.rb +1 -1
- data/lib/blizzard_api/wow/game_data/azerite_essence.rb +1 -1
- data/lib/blizzard_api/wow/game_data/covenant.rb +5 -5
- data/lib/blizzard_api/wow/game_data/creature.rb +6 -6
- data/lib/blizzard_api/wow/game_data/generic_data_endpoint.rb +20 -8
- data/lib/blizzard_api/wow/game_data/guild_crest.rb +2 -2
- data/lib/blizzard_api/wow/game_data/item.rb +6 -6
- data/lib/blizzard_api/wow/game_data/journal.rb +7 -7
- data/lib/blizzard_api/wow/game_data/modified_crafting.rb +4 -4
- data/lib/blizzard_api/wow/game_data/mythic_keystone.rb +6 -6
- data/lib/blizzard_api/wow/game_data/mythic_keystone_affix.rb +1 -1
- data/lib/blizzard_api/wow/game_data/mythic_keystone_leaderboard.rb +2 -2
- data/lib/blizzard_api/wow/game_data/mythic_raid_leaderboard.rb +1 -1
- data/lib/blizzard_api/wow/game_data/pet.rb +4 -4
- data/lib/blizzard_api/wow/game_data/playable_class.rb +8 -8
- data/lib/blizzard_api/wow/game_data/playable_specialization.rb +8 -8
- data/lib/blizzard_api/wow/game_data/profession.rb +4 -4
- data/lib/blizzard_api/wow/game_data/pvp_season.rb +3 -3
- data/lib/blizzard_api/wow/game_data/pvp_tier.rb +1 -1
- data/lib/blizzard_api/wow/game_data/quest.rb +6 -6
- data/lib/blizzard_api/wow/game_data/reputation.rb +4 -4
- data/lib/blizzard_api/wow/game_data/spell.rb +1 -1
- data/lib/blizzard_api/wow/game_data/talent.rb +2 -2
- data/lib/blizzard_api/wow/game_data/tech_talent.rb +3 -3
- data/lib/blizzard_api/wow/game_data/wow_token.rb +1 -1
- data/lib/blizzard_api/wow/profile/character_profile.rb +27 -27
- data/lib/blizzard_api/wow/profile/guild.rb +5 -5
- data/lib/blizzard_api/wow/profile/profile.rb +5 -5
- data/lib/blizzard_api/wow/search/search_request.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7671ab9869534ec9c4c8031eac8e73ac9f389b9199cd9ca61a0e80127de66c53
|
4
|
+
data.tar.gz: 915f7c1ff4b867b4b403dcb55128ab134b5012f380e90a8c589097ba57bf28a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50ce63d400f8997131913f6b677b3676bf68c5134d0acf5328276a37d861073f57004eb3c922821c261608a17610e25c956a1401633d99d25af68cb05c8729f8
|
7
|
+
data.tar.gz: f57a645a37541c1ab06113439529822b84fe71808447303d04b25ba947e368754169e7cb6532482d584061c5a0708b1c7ecf0fe9392c896e236bc132f8c4885b
|
data/.github/workflows/ruby.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
Please view this file on the master branch, otherwise it may be outdated
|
2
2
|
|
3
|
+
**Version 0.6.0**
|
4
|
+
|
5
|
+
Upgraded gem dependencies and refactored the code to support Ruby 3.0.0
|
6
|
+
Required ruby version upgraded to 2.7.2
|
7
|
+
Added concurrency to all WoW game data *complete* methods. Default of 4 threads. Should be close to # of threads available.
|
8
|
+
|
3
9
|
**Version 0.5.6**
|
4
10
|
|
5
11
|
Upgrade gem dependencies to fix a security vulnerability
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
blizzard_api (0.
|
4
|
+
blizzard_api (0.6.0)
|
5
5
|
redis (~> 4.1, >= 4.1.0)
|
6
|
+
thwait (~> 0.2.0)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
11
|
ast (2.4.2)
|
11
12
|
dotenv (2.7.6)
|
13
|
+
e2mmap (0.1.0)
|
12
14
|
minitest (5.14.4)
|
13
15
|
parallel (1.20.1)
|
14
16
|
parser (3.0.1.1)
|
@@ -30,6 +32,8 @@ GEM
|
|
30
32
|
rubocop-ast (1.5.0)
|
31
33
|
parser (>= 3.0.1.1)
|
32
34
|
ruby-progressbar (1.11.0)
|
35
|
+
thwait (0.2.0)
|
36
|
+
e2mmap
|
33
37
|
unicode-display_width (1.7.0)
|
34
38
|
yard (0.9.26)
|
35
39
|
|
@@ -45,4 +49,4 @@ DEPENDENCIES
|
|
45
49
|
yard
|
46
50
|
|
47
51
|
BUNDLED WITH
|
48
|
-
2.
|
52
|
+
2.2.17
|
data/blizzard_api.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'blizzard_api/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.required_ruby_version = '>= 2.
|
8
|
+
spec.required_ruby_version = '>= 2.7.2'
|
9
9
|
spec.name = 'blizzard_api'
|
10
10
|
spec.version = BlizzardApi::VERSION
|
11
11
|
spec.authors = ['Francis Schiavo']
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.require_paths = ['lib']
|
36
36
|
|
37
37
|
spec.add_runtime_dependency 'redis', '~> 4.1', '>= 4.1.0'
|
38
|
+
spec.add_runtime_dependency 'thwait', '~> 0.2.0'
|
38
39
|
|
39
40
|
spec.add_development_dependency 'dotenv'
|
40
41
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
@@ -45,13 +45,12 @@ module BlizzardApi
|
|
45
45
|
attr_accessor :redis_port
|
46
46
|
|
47
47
|
##
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
|
54
|
-
attr_accessor :format
|
48
|
+
#
|
49
|
+
# @!attribute concurrency
|
50
|
+
# How many threads to use for WoW game data `complete` payloads. Defaults to 4.
|
51
|
+
# Should be set to the amount of available cores on the system.
|
52
|
+
# @return [Integer] Concurrency
|
53
|
+
attr_accessor :concurrency
|
55
54
|
|
56
55
|
##
|
57
56
|
# @!attribute access_token
|
@@ -59,33 +58,6 @@ module BlizzardApi
|
|
59
58
|
# @return [String] Access token.
|
60
59
|
attr_accessor :access_token
|
61
60
|
|
62
|
-
##
|
63
|
-
# @!attribute icons_directory
|
64
|
-
# Icons directory.
|
65
|
-
# This directory stores icons for many World of Warcraft endpoints.
|
66
|
-
# @return [String] icons_directory
|
67
|
-
attr_accessor :wow_icons_directory
|
68
|
-
|
69
|
-
##
|
70
|
-
# @!attribute guild_emblem_directory
|
71
|
-
# Guild crest images directory. Some sub directories will be created.
|
72
|
-
# @see https://develop.battle.net/access/clients
|
73
|
-
# @return [String] Guild crest directory
|
74
|
-
attr_accessor :wow_guild_crest_directory
|
75
|
-
|
76
|
-
##
|
77
|
-
# @!attribute wow_character_profile_directory
|
78
|
-
# This directory stores images for World of Warcraft character profiles. Sub directories will be created for
|
79
|
-
# each realm and character.
|
80
|
-
# @return [String] Character profile media directory
|
81
|
-
attr_accessor :wow_character_profile_directory
|
82
|
-
|
83
|
-
##
|
84
|
-
# @!attribute wow_npc_directory
|
85
|
-
# This directory stores images for World of Warcraft NPCs and creatures.
|
86
|
-
# @return [String] NPCs media directory
|
87
|
-
attr_accessor :wow_npc_directory
|
88
|
-
|
89
61
|
##
|
90
62
|
# This method return the singleton instance of the configuration module. Use this to initialize the default values
|
91
63
|
# and options.
|
@@ -110,5 +82,9 @@ module BlizzardApi
|
|
110
82
|
def configure
|
111
83
|
yield self
|
112
84
|
end
|
85
|
+
|
86
|
+
def concurrency
|
87
|
+
@concurrency ||= 4
|
88
|
+
end
|
113
89
|
end
|
114
90
|
end
|
@@ -17,7 +17,7 @@ module BlizzardApi
|
|
17
17
|
#
|
18
18
|
# @!macro response
|
19
19
|
def index(**options)
|
20
|
-
api_request "#{base_url(:community)}/data/act", { ttl: CACHE_TRIMESTER }.merge(options)
|
20
|
+
api_request "#{base_url(:community)}/data/act", **{ ttl: CACHE_TRIMESTER }.merge(options)
|
21
21
|
end
|
22
22
|
|
23
23
|
##
|
@@ -28,7 +28,7 @@ module BlizzardApi
|
|
28
28
|
#
|
29
29
|
# @!macro response
|
30
30
|
def get(id, **options)
|
31
|
-
api_request "#{base_url(:community)}/data/act/#{id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
31
|
+
api_request "#{base_url(:community)}/data/act/#{id}", **{ ttl: CACHE_TRIMESTER }.merge(options)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -18,7 +18,7 @@ module BlizzardApi
|
|
18
18
|
#
|
19
19
|
# @!macro response
|
20
20
|
def get(artisan_slug, **options)
|
21
|
-
api_request "#{base_url(:community)}/data/artisan/#{artisan_slug}", { ttl: CACHE_TRIMESTER }.merge(options)
|
21
|
+
api_request "#{base_url(:community)}/data/artisan/#{artisan_slug}", **{ ttl: CACHE_TRIMESTER }.merge(options)
|
22
22
|
end
|
23
23
|
|
24
24
|
##
|
@@ -31,7 +31,7 @@ module BlizzardApi
|
|
31
31
|
# @!macro response
|
32
32
|
def recipe(artisan_slug, recipe_slug, **options)
|
33
33
|
opts = { ttl: CACHE_TRIMESTER }.merge(options)
|
34
|
-
api_request "#{base_url(:community)}/data/artisan/#{artisan_slug}/recipe/#{recipe_slug}", opts
|
34
|
+
api_request "#{base_url(:community)}/data/artisan/#{artisan_slug}/recipe/#{recipe_slug}", **opts
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -18,7 +18,7 @@ module BlizzardApi
|
|
18
18
|
#
|
19
19
|
# @!macro response
|
20
20
|
def get(class_slug, **options)
|
21
|
-
api_request "#{base_url(:community)}/data/hero/#{class_slug}", { ttl: CACHE_TRIMESTER }.merge(options)
|
21
|
+
api_request "#{base_url(:community)}/data/hero/#{class_slug}", **{ ttl: CACHE_TRIMESTER }.merge(options)
|
22
22
|
end
|
23
23
|
|
24
24
|
##
|
@@ -31,7 +31,7 @@ module BlizzardApi
|
|
31
31
|
# @!macro response
|
32
32
|
def skill(class_slug, skill_slug, **options)
|
33
33
|
opts = { ttl: CACHE_TRIMESTER }.merge(options)
|
34
|
-
api_request "#{base_url(:community)}/data/hero/#{class_slug}/skill/#{skill_slug}", opts
|
34
|
+
api_request "#{base_url(:community)}/data/hero/#{class_slug}/skill/#{skill_slug}", **opts
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -18,7 +18,7 @@ module BlizzardApi
|
|
18
18
|
#
|
19
19
|
# @!macro response
|
20
20
|
def get(follower_slug, **options)
|
21
|
-
api_request "#{base_url(:community)}/data/follower/#{follower_slug}", { ttl: CACHE_TRIMESTER }.merge(options)
|
21
|
+
api_request "#{base_url(:community)}/data/follower/#{follower_slug}", **{ ttl: CACHE_TRIMESTER }.merge(options)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -18,7 +18,7 @@ module BlizzardApi
|
|
18
18
|
#
|
19
19
|
# @!macro response
|
20
20
|
def get(item_slug_and_id, **options)
|
21
|
-
api_request "#{base_url(:community)}/data/item/#{item_slug_and_id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
21
|
+
api_request "#{base_url(:community)}/data/item/#{item_slug_and_id}", **{ ttl: CACHE_TRIMESTER }.merge(options)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -17,7 +17,7 @@ module BlizzardApi
|
|
17
17
|
#
|
18
18
|
# @!macro response
|
19
19
|
def index(**options)
|
20
|
-
api_request "#{base_url(:community)}/data/item-type", { ttl: CACHE_TRIMESTER }.merge(options)
|
20
|
+
api_request "#{base_url(:community)}/data/item-type", **{ ttl: CACHE_TRIMESTER }.merge(options)
|
21
21
|
end
|
22
22
|
|
23
23
|
##
|
@@ -28,7 +28,7 @@ module BlizzardApi
|
|
28
28
|
#
|
29
29
|
# @!macro response
|
30
30
|
def get(item_type_slug, **options)
|
31
|
-
api_request "#{base_url(:community)}/data/item-type/#{item_type_slug}", { ttl: CACHE_TRIMESTER }.merge(options)
|
31
|
+
api_request "#{base_url(:community)}/data/item-type/#{item_type_slug}", **{ ttl: CACHE_TRIMESTER }.merge(options)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -17,7 +17,7 @@ module BlizzardApi
|
|
17
17
|
#
|
18
18
|
# @!macro response
|
19
19
|
def index(**options)
|
20
|
-
api_request "#{base_url(:game_data)}/#{@endpoint}/", default_options.merge(options)
|
20
|
+
api_request "#{base_url(:game_data)}/#{@endpoint}/", **default_options.merge(options)
|
21
21
|
end
|
22
22
|
|
23
23
|
##
|
@@ -28,7 +28,7 @@ module BlizzardApi
|
|
28
28
|
#
|
29
29
|
# @!macro response
|
30
30
|
def get(id, **options)
|
31
|
-
api_request "#{base_url(:game_data)}/#{@endpoint}/#{id}", default_options.merge(options)
|
31
|
+
api_request "#{base_url(:game_data)}/#{@endpoint}/#{id}", **default_options.merge(options)
|
32
32
|
end
|
33
33
|
|
34
34
|
##
|
@@ -41,7 +41,7 @@ module BlizzardApi
|
|
41
41
|
# @!macro response
|
42
42
|
def leaderboard(id, leaderboard_id, **options)
|
43
43
|
opts = default_options.merge(options)
|
44
|
-
api_request "#{base_url(:game_data)}/#{@endpoint}/#{id}/leaderboard/#{leaderboard_id}", opts
|
44
|
+
api_request "#{base_url(:game_data)}/#{@endpoint}/#{id}/leaderboard/#{leaderboard_id}", **opts
|
45
45
|
end
|
46
46
|
|
47
47
|
protected
|
@@ -39,7 +39,7 @@ module BlizzardApi
|
|
39
39
|
def search(search_options = {}, **options)
|
40
40
|
validate_search_options search_options if options.include? :validate_fields
|
41
41
|
|
42
|
-
api_request "#{base_url(:community)}/cardbacks", default_options.merge(options).merge(search_options)
|
42
|
+
api_request "#{base_url(:community)}/cardbacks", **default_options.merge(options).merge(search_options)
|
43
43
|
end
|
44
44
|
|
45
45
|
protected
|
@@ -75,7 +75,7 @@ module BlizzardApi
|
|
75
75
|
def search(search_options = {}, **options)
|
76
76
|
validate_search_options search_options if options.include? :validate_fields
|
77
77
|
|
78
|
-
api_request "#{base_url(:community)}/cards", default_options.merge(options).merge(search_options)
|
78
|
+
api_request "#{base_url(:community)}/cards", **default_options.merge(options).merge(search_options)
|
79
79
|
end
|
80
80
|
|
81
81
|
##
|
@@ -91,7 +91,7 @@ module BlizzardApi
|
|
91
91
|
#
|
92
92
|
# @!macro response
|
93
93
|
def get(id_or_slug, game_mode = 'constructed', **options)
|
94
|
-
super id_or_slug, { gameMode: game_mode }.merge(options)
|
94
|
+
super id_or_slug, **{ gameMode: game_mode }.merge(options)
|
95
95
|
end
|
96
96
|
|
97
97
|
protected
|
@@ -21,7 +21,7 @@ module BlizzardApi
|
|
21
21
|
#
|
22
22
|
# @!macro response
|
23
23
|
def index(**options)
|
24
|
-
api_request "#{base_url(:community)}/#{@endpoint}/", default_options.merge(options)
|
24
|
+
api_request "#{base_url(:community)}/#{@endpoint}/", **default_options.merge(options)
|
25
25
|
end
|
26
26
|
|
27
27
|
##
|
@@ -32,7 +32,7 @@ module BlizzardApi
|
|
32
32
|
#
|
33
33
|
# @!macro response
|
34
34
|
def get(id, **options)
|
35
|
-
api_request "#{base_url(:community)}/#{@endpoint}/#{id}", default_options.merge(options)
|
35
|
+
api_request "#{base_url(:community)}/#{@endpoint}/#{id}", **default_options.merge(options)
|
36
36
|
end
|
37
37
|
|
38
38
|
protected
|
data/lib/blizzard_api/request.rb
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
# @option options [Boolean] :ignore_cache If set to true the request will not use the cache
|
10
10
|
# @option options [Integer] :ttl Override the default time (in seconds) a request should be cached
|
11
11
|
# @option options [DateTime] :since Adds the If-modified-since headers. Will always ignore cache when set.
|
12
|
+
# @option options [Integer] :concurrency How many threads to use for complete sets of data. BEWARE: Might cause 429 responses, in this case lower the number.
|
12
13
|
|
13
14
|
##
|
14
15
|
# @!macro [new] regions
|
@@ -124,7 +125,7 @@ module BlizzardApi
|
|
124
125
|
# If data was found that means cache is enabled and valid
|
125
126
|
return JSON.parse(data, symbolize_names: true) if data
|
126
127
|
|
127
|
-
response = consume_api parsed_url, options
|
128
|
+
response = consume_api parsed_url, **options
|
128
129
|
|
129
130
|
save_in_cache parsed_url.to_s, response.body, options[:ttl] || CACHE_DAY if using_cache? options
|
130
131
|
|
@@ -134,7 +135,7 @@ module BlizzardApi
|
|
134
135
|
response_data
|
135
136
|
end
|
136
137
|
|
137
|
-
def api_request(uri, query_string
|
138
|
+
def api_request(uri, **query_string)
|
138
139
|
# List of request options
|
139
140
|
options_key = %i[ignore_cache ttl format access_token namespace classic headers since]
|
140
141
|
|
@@ -150,7 +151,7 @@ module BlizzardApi
|
|
150
151
|
uri = uri.include?('?') ? "#{uri}&#{query_string}" : "#{uri}?#{query_string}"
|
151
152
|
end
|
152
153
|
|
153
|
-
request uri, options
|
154
|
+
request uri, **options
|
154
155
|
end
|
155
156
|
|
156
157
|
private
|
@@ -174,7 +175,7 @@ module BlizzardApi
|
|
174
175
|
# Executes the request
|
175
176
|
http.request(request).tap do |response|
|
176
177
|
if mode.eql?(:regular) && ![200, 304].include?(response.code.to_i)
|
177
|
-
raise BlizzardApi::ApiException.new
|
178
|
+
raise BlizzardApi::ApiException.new "Request failed with code '#{response.code}' details: #{response.to_hash}", response.code.to_i
|
178
179
|
end
|
179
180
|
end
|
180
181
|
end
|
@@ -17,7 +17,7 @@ module BlizzardApi
|
|
17
17
|
# @!macro request_options
|
18
18
|
def grandmaster(region_id, **options)
|
19
19
|
reg = resolve_region(region_id)
|
20
|
-
api_request "#{base_url(:community)}/ladder/grandmaster/#{reg}", { ttl: CACHE_DAY }.merge(options)
|
20
|
+
api_request "#{base_url(:community)}/ladder/grandmaster/#{reg}", **{ ttl: CACHE_DAY }.merge(options)
|
21
21
|
end
|
22
22
|
|
23
23
|
##
|
@@ -27,7 +27,7 @@ module BlizzardApi
|
|
27
27
|
# @!macro request_options
|
28
28
|
def season(region_id, **options)
|
29
29
|
reg = resolve_region(region_id)
|
30
|
-
api_request "#{base_url(:community)}/ladder/season/#{reg}", { ttl: CACHE_DAY }.merge(options)
|
30
|
+
api_request "#{base_url(:community)}/ladder/season/#{reg}", **{ ttl: CACHE_DAY }.merge(options)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -17,7 +17,7 @@ module BlizzardApi
|
|
17
17
|
# @!macro request_options
|
18
18
|
def static(region_id, **options)
|
19
19
|
reg = resolve_region(region_id)
|
20
|
-
api_request "#{base_url(:community)}/static/profile/#{reg}", { ttl: CACHE_DAY }.merge(options)
|
20
|
+
api_request "#{base_url(:community)}/static/profile/#{reg}", **{ ttl: CACHE_DAY }.merge(options)
|
21
21
|
end
|
22
22
|
|
23
23
|
##
|
@@ -30,7 +30,7 @@ module BlizzardApi
|
|
30
30
|
def metadata(region_id, realm_id, profile_id, **options)
|
31
31
|
reg = resolve_region(region_id)
|
32
32
|
opts = { ttl: CACHE_DAY }.merge(options)
|
33
|
-
api_request "#{base_url(:community)}/metadata/profile/#{reg}/#{realm_id}/#{profile_id}", opts
|
33
|
+
api_request "#{base_url(:community)}/metadata/profile/#{reg}/#{realm_id}/#{profile_id}", **opts
|
34
34
|
end
|
35
35
|
|
36
36
|
##
|
@@ -43,7 +43,7 @@ module BlizzardApi
|
|
43
43
|
def profile(region_id, realm_id, profile_id, **options)
|
44
44
|
reg = resolve_region(region_id)
|
45
45
|
opts = { ttl: CACHE_DAY }.merge(options)
|
46
|
-
api_request "#{base_url(:community)}/profile/#{reg}/#{realm_id}/#{profile_id}", opts
|
46
|
+
api_request "#{base_url(:community)}/profile/#{reg}/#{realm_id}/#{profile_id}", **opts
|
47
47
|
end
|
48
48
|
|
49
49
|
##
|
@@ -56,7 +56,7 @@ module BlizzardApi
|
|
56
56
|
def ladder_summary(region_id, realm_id, profile_id, **options)
|
57
57
|
reg = resolve_region(region_id)
|
58
58
|
opts = { ttl: CACHE_DAY }.merge(options)
|
59
|
-
api_request "#{base_url(:community)}profile/#{reg}/#{realm_id}/#{profile_id}/ladder/summary ", opts
|
59
|
+
api_request "#{base_url(:community)}profile/#{reg}/#{realm_id}/#{profile_id}/ladder/summary ", **opts
|
60
60
|
end
|
61
61
|
|
62
62
|
##
|
@@ -69,7 +69,7 @@ module BlizzardApi
|
|
69
69
|
def ladder(region_id, realm_id, profile_id, ladder_id, **options)
|
70
70
|
reg = resolve_region(region_id)
|
71
71
|
opts = { ttl: CACHE_DAY }.merge(options)
|
72
|
-
api_request "#{base_url(:community)}/profile/#{reg}/#{realm_id}/#{profile_id}/ladder/#{ladder_id}", opts
|
72
|
+
api_request "#{base_url(:community)}/profile/#{reg}/#{realm_id}/#{profile_id}/ladder/#{ladder_id}", **opts
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -20,7 +20,7 @@ module BlizzardApi
|
|
20
20
|
# @!macro request_options
|
21
21
|
def get(season_id, queue_id, team_type, league_id, **options)
|
22
22
|
opts = { ttl: CACHE_DAY }.merge(options)
|
23
|
-
api_request "#{base_url(:game_data)}/league/#{season_id}/#{queue_id}/#{team_type}/#{league_id}", opts
|
23
|
+
api_request "#{base_url(:game_data)}/league/#{season_id}/#{queue_id}/#{team_type}/#{league_id}", **opts
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/blizzard_api/version.rb
CHANGED
@@ -25,7 +25,7 @@ module BlizzardApi
|
|
25
25
|
#
|
26
26
|
# @!macro response
|
27
27
|
def categories(**options)
|
28
|
-
api_request "#{endpoint_uri('category')}/index", default_options.merge(options)
|
28
|
+
api_request "#{endpoint_uri('category')}/index", **default_options.merge(options)
|
29
29
|
end
|
30
30
|
|
31
31
|
##
|
@@ -35,7 +35,7 @@ module BlizzardApi
|
|
35
35
|
#
|
36
36
|
# @!macro response
|
37
37
|
def category(id, **options)
|
38
|
-
api_request "#{endpoint_uri('category')}/#{id}", default_options.merge(options)
|
38
|
+
api_request "#{endpoint_uri('category')}/#{id}", **default_options.merge(options)
|
39
39
|
end
|
40
40
|
|
41
41
|
##
|
@@ -45,7 +45,7 @@ module BlizzardApi
|
|
45
45
|
#
|
46
46
|
# @!macro response
|
47
47
|
def media(id, **options)
|
48
|
-
api_request "#{base_url(:media)}/achievement/#{id}", default_options.merge(options)
|
48
|
+
api_request "#{base_url(:media)}/achievement/#{id}", **default_options.merge(options)
|
49
49
|
end
|
50
50
|
|
51
51
|
protected
|