blizzard_api 0.3.1 → 0.3.2
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 +4 -4
- data/.gitlab-ci.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +4 -4
- data/blizzard_api.gemspec +1 -1
- data/lib/blizzard_api/request.rb +2 -1
- data/lib/blizzard_api/version.rb +1 -1
- data/lib/blizzard_api/wow.rb +86 -68
- data/lib/blizzard_api/wow/game_data/achievement.rb +0 -16
- data/lib/blizzard_api/wow/game_data/auction.rb +26 -0
- data/lib/blizzard_api/wow/game_data/item.rb +22 -34
- data/lib/blizzard_api/wow/game_data/journal.rb +110 -0
- data/lib/blizzard_api/wow/game_data/mount.rb +0 -14
- data/lib/blizzard_api/wow/game_data/pet.rb +0 -75
- data/lib/blizzard_api/wow/game_data/playable_class.rb +0 -15
- data/lib/blizzard_api/wow/game_data/{reputation_tier.rb → playable_race.rb} +5 -5
- data/lib/blizzard_api/wow/game_data/pvp_tier.rb +1 -1
- data/lib/blizzard_api/wow/game_data/quest.rb +86 -0
- data/lib/blizzard_api/wow/game_data/reputation.rb +81 -0
- data/lib/blizzard_api/wow/game_data/spell.rb +51 -0
- data/lib/blizzard_api/wow/game_data/talent.rb +45 -0
- data/lib/blizzard_api/wow/profile/character_profile.rb +32 -33
- data/lib/blizzard_api/wow/{game_data → profile}/guild.rb +14 -33
- data/lib/blizzard_api/wow/profile/profile.rb +75 -0
- metadata +13 -11
- data/lib/blizzard_api/wow/community/auction.rb +0 -27
- data/lib/blizzard_api/wow/community/quest.rb +0 -27
- data/lib/blizzard_api/wow/community/spell.rb +0 -27
- data/lib/blizzard_api/wow/game_data/race.rb +0 -38
- data/lib/blizzard_api/wow/game_data/reputation_faction.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b9d57b5dea588a84d7b4d4a66f9885e42b66f3fc6e0be13eebca4b90fab564c
|
4
|
+
data.tar.gz: 9b97294d3acaeb1525cd5844519ba2a77e088975bf542184d6933d48123730c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db17c607f96ae46eebda6cfc550f297bd371898768a1b50da531818855d591baf7e5f0f76a63a2786d95f2010d9e3cc41977f7e8e35ef4b86db30ee2ecd1c26b
|
7
|
+
data.tar.gz: eaba5b7b425e781608a36cc9258085fc98f2da4268710ffa2b4c8c324ec129ac087327d94c33749840e6bac67fa81d24af58ad2d4ac8d504c8997ad4cad8dbf4
|
data/.gitlab-ci.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.3.2**
|
4
|
+
|
5
|
+
Added new WoW endpoints: https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-api-update-visions-of-nzoth/3461
|
6
|
+
|
7
|
+
**Attention:** Removed compatibility with community endpoints for all migrated endpoints.
|
8
|
+
|
3
9
|
**Version 0.3.1**
|
4
10
|
|
5
11
|
https://us.forums.blizzard.com/en/blizzard/t/hearthstone-api-updates/2978
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
blizzard_api (0.3.
|
4
|
+
blizzard_api (0.3.2)
|
5
5
|
redis (~> 4.1, >= 4.1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -14,8 +14,8 @@ GEM
|
|
14
14
|
parser (2.6.3.0)
|
15
15
|
ast (~> 2.4.0)
|
16
16
|
rainbow (3.0.0)
|
17
|
-
rake (
|
18
|
-
redis (4.1.
|
17
|
+
rake (13.0.1)
|
18
|
+
redis (4.1.3)
|
19
19
|
rubocop (0.74.0)
|
20
20
|
jaro_winkler (~> 1.5.1)
|
21
21
|
parallel (~> 1.10)
|
@@ -32,7 +32,7 @@ PLATFORMS
|
|
32
32
|
DEPENDENCIES
|
33
33
|
blizzard_api!
|
34
34
|
minitest (~> 5.0)
|
35
|
-
rake (~>
|
35
|
+
rake (~> 13.0)
|
36
36
|
rubocop (~> 0.61)
|
37
37
|
|
38
38
|
BUNDLED WITH
|
data/blizzard_api.gemspec
CHANGED
@@ -35,6 +35,6 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_runtime_dependency 'redis', '~> 4.1', '>= 4.1.0'
|
36
36
|
|
37
37
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
38
|
-
spec.add_development_dependency 'rake', '~>
|
38
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
39
39
|
spec.add_development_dependency 'rubocop', '~> 0.61'
|
40
40
|
end
|
data/lib/blizzard_api/request.rb
CHANGED
@@ -50,7 +50,8 @@ module BlizzardApi
|
|
50
50
|
game_data: 'https://%s.api.blizzard.com/data/%s',
|
51
51
|
community: 'https://%s.api.blizzard.com/%s',
|
52
52
|
profile: 'https://%s.api.blizzard.com/profile/%s',
|
53
|
-
media: 'https://%s.api.blizzard.com/data/%s/media'
|
53
|
+
media: 'https://%s.api.blizzard.com/data/%s/media',
|
54
|
+
user_profile: 'https://%s.api.blizzard.com/profile/user/%s'
|
54
55
|
}.freeze
|
55
56
|
|
56
57
|
##
|
data/lib/blizzard_api/version.rb
CHANGED
data/lib/blizzard_api/wow.rb
CHANGED
@@ -8,30 +8,33 @@ module BlizzardApi
|
|
8
8
|
|
9
9
|
# WoW data api
|
10
10
|
require_relative 'wow/game_data/achievement'
|
11
|
+
require_relative 'wow/game_data/auction'
|
12
|
+
require_relative 'wow/game_data/azerite_essence'
|
11
13
|
require_relative 'wow/game_data/connected_realm'
|
12
14
|
require_relative 'wow/game_data/creature'
|
13
|
-
require_relative 'wow/game_data/guild'
|
14
15
|
require_relative 'wow/game_data/guild_crest'
|
16
|
+
require_relative 'wow/game_data/item'
|
17
|
+
require_relative 'wow/game_data/journal'
|
18
|
+
require_relative 'wow/game_data/mount'
|
15
19
|
require_relative 'wow/game_data/mythic_keystone_affix'
|
16
20
|
require_relative 'wow/game_data/mythic_keystone'
|
17
21
|
require_relative 'wow/game_data/mythic_raid_leaderboard'
|
18
|
-
require_relative 'wow/game_data/mount'
|
19
22
|
require_relative 'wow/game_data/mythic_keystone_leaderboard'
|
20
23
|
require_relative 'wow/game_data/pet'
|
21
24
|
require_relative 'wow/game_data/playable_class'
|
25
|
+
require_relative 'wow/game_data/playable_race'
|
22
26
|
require_relative 'wow/game_data/playable_specialization'
|
23
27
|
require_relative 'wow/game_data/power_type'
|
24
28
|
require_relative 'wow/game_data/pvp_season'
|
25
29
|
require_relative 'wow/game_data/pvp_tier'
|
30
|
+
require_relative 'wow/game_data/quest'
|
26
31
|
require_relative 'wow/game_data/realm'
|
27
32
|
require_relative 'wow/game_data/region'
|
28
|
-
require_relative 'wow/game_data/
|
29
|
-
require_relative 'wow/game_data/
|
33
|
+
require_relative 'wow/game_data/reputation'
|
34
|
+
require_relative 'wow/game_data/spell'
|
35
|
+
require_relative 'wow/game_data/talent'
|
30
36
|
require_relative 'wow/game_data/title'
|
31
|
-
require_relative 'wow/game_data/
|
32
|
-
require_relative 'wow/game_data/azerite_essence'
|
33
|
-
require_relative 'wow/game_data/reputation_tier'
|
34
|
-
require_relative 'wow/game_data/reputation_faction'
|
37
|
+
require_relative 'wow/game_data/wow_token'
|
35
38
|
|
36
39
|
##
|
37
40
|
# @return {Achievement}
|
@@ -39,6 +42,18 @@ module BlizzardApi
|
|
39
42
|
BlizzardApi::Wow::Achievement.new
|
40
43
|
end
|
41
44
|
|
45
|
+
##
|
46
|
+
# @return {Auction}
|
47
|
+
def self.auction
|
48
|
+
BlizzardApi::Wow::Auction.new
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# @return {AzeriteEssence}
|
53
|
+
def self.azerite_essence
|
54
|
+
BlizzardApi::Wow::AzeriteEssence.new
|
55
|
+
end
|
56
|
+
|
42
57
|
##
|
43
58
|
# @return {ConnectedRealm}
|
44
59
|
def self.connected_realm
|
@@ -51,18 +66,30 @@ module BlizzardApi
|
|
51
66
|
BlizzardApi::Wow::Creature.new
|
52
67
|
end
|
53
68
|
|
54
|
-
##
|
55
|
-
# @return {Guild}
|
56
|
-
def self.guild
|
57
|
-
BlizzardApi::Wow::Guild.new
|
58
|
-
end
|
59
|
-
|
60
69
|
##
|
61
70
|
# @return {GuildCrest}
|
62
71
|
def self.guild_crest
|
63
72
|
BlizzardApi::Wow::GuildCrest.new
|
64
73
|
end
|
65
74
|
|
75
|
+
##
|
76
|
+
# @return {Item}
|
77
|
+
def self.item
|
78
|
+
BlizzardApi::Wow::Item.new
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# @return {Journal}
|
83
|
+
def self.journal
|
84
|
+
BlizzardApi::Wow::Journal.new
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# @return {Mount}
|
89
|
+
def self.mount
|
90
|
+
BlizzardApi::Wow::Mount.new
|
91
|
+
end
|
92
|
+
|
66
93
|
##
|
67
94
|
# @return {MythicKeystoneAffix}
|
68
95
|
def self.mythic_keystone_affix
|
@@ -81,12 +108,6 @@ module BlizzardApi
|
|
81
108
|
BlizzardApi::Wow::MythicRaidLeaderboard.new
|
82
109
|
end
|
83
110
|
|
84
|
-
##
|
85
|
-
# @return {Mount}
|
86
|
-
def self.mount
|
87
|
-
BlizzardApi::Wow::Mount.new
|
88
|
-
end
|
89
|
-
|
90
111
|
##
|
91
112
|
# @return {MythicKeystoneLeaderboard}
|
92
113
|
def self.mythic_keystone_leaderboard
|
@@ -105,6 +126,12 @@ module BlizzardApi
|
|
105
126
|
BlizzardApi::Wow::PlayableClass.new
|
106
127
|
end
|
107
128
|
|
129
|
+
##
|
130
|
+
# @return {Race}
|
131
|
+
def self.playable_race
|
132
|
+
BlizzardApi::Wow::PlayableRace.new
|
133
|
+
end
|
134
|
+
|
108
135
|
##
|
109
136
|
# @return {PlayableSpecialization}
|
110
137
|
def self.playable_specialization
|
@@ -129,6 +156,12 @@ module BlizzardApi
|
|
129
156
|
BlizzardApi::Wow::PvpTier.new
|
130
157
|
end
|
131
158
|
|
159
|
+
##
|
160
|
+
# @return {Quest}
|
161
|
+
def self.quest
|
162
|
+
BlizzardApi::Wow::Quest.new
|
163
|
+
end
|
164
|
+
|
132
165
|
##
|
133
166
|
# @return {Realm}
|
134
167
|
def self.realm
|
@@ -142,63 +175,42 @@ module BlizzardApi
|
|
142
175
|
end
|
143
176
|
|
144
177
|
##
|
145
|
-
# @return {
|
146
|
-
def self.
|
147
|
-
BlizzardApi::Wow::
|
148
|
-
end
|
149
|
-
|
150
|
-
##
|
151
|
-
# @return {Race}
|
152
|
-
def self.race
|
153
|
-
BlizzardApi::Wow::Race.new
|
154
|
-
end
|
155
|
-
|
156
|
-
##
|
157
|
-
# @return {Title}
|
158
|
-
def self.title
|
159
|
-
BlizzardApi::Wow::Title.new
|
178
|
+
# @return {Reputation}
|
179
|
+
def self.reputation
|
180
|
+
BlizzardApi::Wow::Reputation.new
|
160
181
|
end
|
161
182
|
|
162
183
|
##
|
163
|
-
# @return {
|
164
|
-
def self.
|
165
|
-
BlizzardApi::Wow::
|
184
|
+
# @return {Spell}
|
185
|
+
def self.spell
|
186
|
+
BlizzardApi::Wow::Spell.new
|
166
187
|
end
|
167
188
|
|
168
189
|
##
|
169
|
-
# @return {
|
170
|
-
def self.
|
171
|
-
BlizzardApi::Wow::
|
190
|
+
# @return {Talent}
|
191
|
+
def self.talent
|
192
|
+
BlizzardApi::Wow::Talent.new
|
172
193
|
end
|
173
194
|
|
174
195
|
##
|
175
|
-
# @return {
|
176
|
-
def self.
|
177
|
-
BlizzardApi::Wow::
|
196
|
+
# @return {Title}
|
197
|
+
def self.title
|
198
|
+
BlizzardApi::Wow::Title.new
|
178
199
|
end
|
179
200
|
|
180
201
|
##
|
181
|
-
# @return {
|
182
|
-
def self.
|
183
|
-
BlizzardApi::Wow::
|
202
|
+
# @return {WowToken}
|
203
|
+
def self.wow_token
|
204
|
+
BlizzardApi::Wow::WowToken.new
|
184
205
|
end
|
185
206
|
|
186
207
|
# Wow community api
|
187
|
-
require_relative 'wow/community/auction'
|
188
208
|
require_relative 'wow/community/boss'
|
189
209
|
require_relative 'wow/community/challenge'
|
190
210
|
require_relative 'wow/community/pvp'
|
191
|
-
require_relative 'wow/community/quest'
|
192
211
|
require_relative 'wow/community/recipe'
|
193
|
-
require_relative 'wow/community/spell'
|
194
212
|
require_relative 'wow/community/zone'
|
195
213
|
|
196
|
-
##
|
197
|
-
# @return {Auction}
|
198
|
-
def self.auction
|
199
|
-
BlizzardApi::Wow::Auction.new
|
200
|
-
end
|
201
|
-
|
202
214
|
##
|
203
215
|
# @return {Boss}
|
204
216
|
def self.boss
|
@@ -223,32 +235,38 @@ module BlizzardApi
|
|
223
235
|
BlizzardApi::Wow::PvP.new
|
224
236
|
end
|
225
237
|
|
226
|
-
##
|
227
|
-
# @return {Quest}
|
228
|
-
def self.quest
|
229
|
-
BlizzardApi::Wow::Quest.new
|
230
|
-
end
|
231
|
-
|
232
238
|
##
|
233
239
|
# @return {Recipe}
|
234
240
|
def self.recipe
|
235
241
|
BlizzardApi::Wow::Recipe.new
|
236
242
|
end
|
237
243
|
|
238
|
-
##
|
239
|
-
# @return {Spell}
|
240
|
-
def self.spell
|
241
|
-
BlizzardApi::Wow::Spell.new
|
242
|
-
end
|
243
|
-
|
244
244
|
##
|
245
245
|
# @return {Zone}
|
246
246
|
def self.zone
|
247
247
|
BlizzardApi::Wow::Zone.new
|
248
248
|
end
|
249
249
|
|
250
|
+
require_relative 'wow/profile/profile'
|
251
|
+
require_relative 'wow/profile/guild'
|
250
252
|
require_relative 'wow/profile/character_profile'
|
251
253
|
|
254
|
+
##
|
255
|
+
# @param token [String] A token obtained using the authorization_code flow
|
256
|
+
#
|
257
|
+
# @!macro request_options
|
258
|
+
#
|
259
|
+
# @return {Profile}
|
260
|
+
def self.profile(token)
|
261
|
+
BlizzardApi::Wow::Profile.new(token)
|
262
|
+
end
|
263
|
+
|
264
|
+
##
|
265
|
+
# @return {Guild}
|
266
|
+
def self.guild
|
267
|
+
BlizzardApi::Wow::Guild.new
|
268
|
+
end
|
269
|
+
|
252
270
|
##
|
253
271
|
# @return {CharacterProfile}
|
254
272
|
def self.character_profile
|
@@ -10,22 +10,6 @@ module BlizzardApi
|
|
10
10
|
# You can get an instance of this class using the default region as follows:
|
11
11
|
# api_instance = BlizzardApi::Wow.achievement
|
12
12
|
class Achievement < Wow::GenericDataEndpoint
|
13
|
-
##
|
14
|
-
# Fetch all possible data for one of the items listed by the {#index} using its *id*
|
15
|
-
#
|
16
|
-
# @param id [Integer] One of the IDs returned by the {#index}
|
17
|
-
#
|
18
|
-
# @!macro request_options
|
19
|
-
# @option options [Boolean] :use_community_endpoint If set to true, this method will call the community endpoint
|
20
|
-
# instead of the data endpoint https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
|
21
|
-
#
|
22
|
-
# @!macro response
|
23
|
-
def get(id, options = {})
|
24
|
-
return super id, options unless options.include? :use_community_endpoint
|
25
|
-
|
26
|
-
api_request "#{base_url(:community)}/achievement/#{id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
27
|
-
end
|
28
|
-
|
29
13
|
##
|
30
14
|
# This method overrides the inherited default behavior to prevent high server load and fetch time
|
31
15
|
#
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BlizzardApi
|
4
|
+
module Wow
|
5
|
+
##
|
6
|
+
# This class allows access to World of Warcraft auctions
|
7
|
+
#
|
8
|
+
# @see https://develop.battle.net/documentation/world-of-warcraft/game-data-apis
|
9
|
+
#
|
10
|
+
# You can get an instance of this class using the default region as follows:
|
11
|
+
# api_instance = BlizzardApi::Wow.auction
|
12
|
+
class Auction < Wow::Request
|
13
|
+
##
|
14
|
+
# Return all active auctions for the specified connected realm
|
15
|
+
#
|
16
|
+
# @param connected_realm_id [Integer] A valid connected realm id
|
17
|
+
# @!macro request_options
|
18
|
+
#
|
19
|
+
# @!macro response
|
20
|
+
def get(connected_realm_id, options = {})
|
21
|
+
opts = { ttl: CACHE_HOUR, namespace: :dynamic }.merge(options)
|
22
|
+
api_request "#{base_url(:game_data)}/connected-realm/#{connected_realm_id}/auctions", opts
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -5,7 +5,7 @@ module BlizzardApi
|
|
5
5
|
##
|
6
6
|
# This class allows access to World of Warcraft item data
|
7
7
|
#
|
8
|
-
# @see https://develop.battle.net/documentation/
|
8
|
+
# @see https://develop.battle.net/documentation/world-of-warcraft/game-data-apis
|
9
9
|
#
|
10
10
|
# You can get an instance of this class using the default region as follows:
|
11
11
|
# api_instance = BlizzardApi::Wow.item
|
@@ -26,47 +26,14 @@ module BlizzardApi
|
|
26
26
|
raise BlizzardApi::ApiException, 'This endpoint does not have a complete method'
|
27
27
|
end
|
28
28
|
|
29
|
-
##
|
30
|
-
# Return complete data of an item by id
|
31
|
-
#
|
32
|
-
# @param id [Integer] Item id
|
33
|
-
# @!macro request_options
|
34
|
-
# @option options [Boolean] :use_community_endpoint If set to true, this method will call the community endpoint
|
35
|
-
# instead of the data endpoint https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
|
36
|
-
# @option options [Boolean] :classic If set to true, this method will call the classic version
|
37
|
-
#
|
38
|
-
# @!macro response
|
39
|
-
def get(id, options = {})
|
40
|
-
return super id, options unless options.include? :use_community_endpoint
|
41
|
-
|
42
|
-
api_request "#{base_url(:community)}/item/#{id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
43
|
-
end
|
44
|
-
|
45
|
-
##
|
46
|
-
# Return complete data of an item set by id
|
47
|
-
#
|
48
|
-
# @param set_id [Integer] Item set id
|
49
|
-
# @!macro request_options
|
50
|
-
#
|
51
|
-
# @!macro response
|
52
|
-
def item_set(set_id, options = {})
|
53
|
-
api_request "#{base_url(:community)}/item/set/#{set_id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
54
|
-
end
|
55
|
-
|
56
29
|
##
|
57
30
|
# Return a list of item classes
|
58
31
|
#
|
59
32
|
# @!macro request_options
|
60
|
-
# @option options [Boolean] :use_community_endpoint If set to true, this method will call the community endpoint
|
61
|
-
# instead of the data endpoint https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
|
62
33
|
# @option options [Boolean] :classic If set to true, this method will call the classic version
|
63
34
|
#
|
64
35
|
# @!macro response
|
65
36
|
def classes(options = {})
|
66
|
-
if options.include? :use_community_endpoint
|
67
|
-
return api_request "#{base_url(:community)}/data/item/classes", { ttl: CACHE_TRIMESTER }.merge(options)
|
68
|
-
end
|
69
|
-
|
70
37
|
api_request "#{endpoint_uri('class')}/index", default_options.merge(options)
|
71
38
|
end
|
72
39
|
|
@@ -108,6 +75,27 @@ module BlizzardApi
|
|
108
75
|
api_request "#{base_url(:media)}/item/#{id}", default_options.merge(options)
|
109
76
|
end
|
110
77
|
|
78
|
+
##
|
79
|
+
# Return a list of item sets
|
80
|
+
#
|
81
|
+
# @!macro request_options
|
82
|
+
#
|
83
|
+
# @!macro response
|
84
|
+
def sets(options = {})
|
85
|
+
api_request "#{endpoint_uri('set')}/index", default_options.merge(options)
|
86
|
+
end
|
87
|
+
|
88
|
+
##
|
89
|
+
# Return data about an item set
|
90
|
+
#
|
91
|
+
# @param id [Integer] Item set id
|
92
|
+
# @!macro request_options
|
93
|
+
#
|
94
|
+
# @!macro response
|
95
|
+
def set(id, options = {})
|
96
|
+
api_request "#{endpoint_uri('set')}/#{id}", default_options.merge(options)
|
97
|
+
end
|
98
|
+
|
111
99
|
protected
|
112
100
|
|
113
101
|
def endpoint_setup
|