blizzard_api 0.2.2 → 0.2.3
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/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +12 -4
- data/lib/blizzard_api/version.rb +1 -1
- data/lib/blizzard_api/wow.rb +21 -7
- data/lib/blizzard_api/wow/game_data/azerite_essence.rb +23 -0
- data/lib/blizzard_api/wow/game_data/item.rb +104 -0
- data/lib/blizzard_api/wow/game_data/title.rb +31 -0
- metadata +4 -2
- data/lib/blizzard_api/wow/community/item.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8912dbf1d2428d658df1a48f5e24f4eda29a1bf40b6882851d899b35ebecd678
|
4
|
+
data.tar.gz: b97d376156394a7c529ab7ff42ec67227307141e9037ba015aaf9114636228ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5592ee0340659d8c20e301b27f48b8f213b0b71df70b8024f5b8177ab89d22c1f1b080f5b55e22bb4ebe63c9c442cfe40c83ad4071b19e28ec92bc8cfedd15bc
|
7
|
+
data.tar.gz: fba6de77e9c6e60ed932dcdb53fecdc3a1003563f71681691b3015ab0af2dc03174ebe97e3f4b51db5f5af31d82a5f1f55d0fc3c1f125f1e89addda3405d2ec1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
Please view this file on the master branch, otherwise it may be outdated
|
2
2
|
|
3
|
+
**Version 0.2.3**
|
4
|
+
* Added new api endpoints listed here: https://us.battle.net/forums/en/bnet/topic/20772337044
|
5
|
+
|
3
6
|
**Version 0.2.2**
|
4
7
|
* Added new api endpoints listed here: https://us.battle.net/forums/en/bnet/topic/20771546990
|
5
8
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -177,7 +177,18 @@ Most **data** endpoints will have always 3 methods available `index`, `get` and
|
|
177
177
|
- index
|
178
178
|
- get :id
|
179
179
|
- complete
|
180
|
-
|
180
|
+
* Blizzard::Wow::Title
|
181
|
+
- index
|
182
|
+
- get :id
|
183
|
+
* Blizzard::Wow::Item
|
184
|
+
- get :id
|
185
|
+
- item_set :id
|
186
|
+
- classes
|
187
|
+
- class :id
|
188
|
+
- subclass :class_id, :subclass_id
|
189
|
+
* Blizzard::Wow::AzeriteEssence
|
190
|
+
- index
|
191
|
+
- get :id
|
181
192
|
|
182
193
|
* Blizzard::Wow::Auction
|
183
194
|
- get :realm
|
@@ -195,9 +206,6 @@ Most **data** endpoints will have always 3 methods available `index`, `get` and
|
|
195
206
|
- get :relam, :name, :fields
|
196
207
|
- rewards
|
197
208
|
- perks
|
198
|
-
* Blizzard::Wow::Item
|
199
|
-
- get :id
|
200
|
-
- item_set :setId
|
201
209
|
* Blizzard::Wow::PvP
|
202
210
|
- get :bracket
|
203
211
|
* Blizzard::Wow::Quest
|
data/lib/blizzard_api/version.rb
CHANGED
data/lib/blizzard_api/wow.rb
CHANGED
@@ -27,6 +27,9 @@ module BlizzardApi
|
|
27
27
|
require_relative 'wow/game_data/region'
|
28
28
|
require_relative 'wow/game_data/wow_token'
|
29
29
|
require_relative 'wow/game_data/race'
|
30
|
+
require_relative 'wow/game_data/title'
|
31
|
+
require_relative 'wow/game_data/item'
|
32
|
+
require_relative 'wow/game_data/azerite_essence'
|
30
33
|
|
31
34
|
##
|
32
35
|
# @return {Achievement}
|
@@ -148,12 +151,29 @@ module BlizzardApi
|
|
148
151
|
BlizzardApi::Wow::Race.new
|
149
152
|
end
|
150
153
|
|
154
|
+
##
|
155
|
+
# @return {Title}
|
156
|
+
def self.title
|
157
|
+
BlizzardApi::Wow::Title.new
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# @return {Item}
|
162
|
+
def self.item
|
163
|
+
BlizzardApi::Wow::Item.new
|
164
|
+
end
|
165
|
+
|
166
|
+
##
|
167
|
+
# @return {AzeriteEssence}
|
168
|
+
def self.azerite_essence
|
169
|
+
BlizzardApi::Wow::AzeriteEssence.new
|
170
|
+
end
|
171
|
+
|
151
172
|
# Wow community api
|
152
173
|
require_relative 'wow/community/auction'
|
153
174
|
require_relative 'wow/community/boss'
|
154
175
|
require_relative 'wow/community/challenge'
|
155
176
|
require_relative 'wow/community/character'
|
156
|
-
require_relative 'wow/community/item'
|
157
177
|
require_relative 'wow/community/pvp'
|
158
178
|
require_relative 'wow/community/quest'
|
159
179
|
require_relative 'wow/community/recipe'
|
@@ -184,12 +204,6 @@ module BlizzardApi
|
|
184
204
|
BlizzardApi::Wow::Character.new
|
185
205
|
end
|
186
206
|
|
187
|
-
##
|
188
|
-
# @return {Item}
|
189
|
-
def self.item
|
190
|
-
BlizzardApi::Wow::Item.new
|
191
|
-
end
|
192
|
-
|
193
207
|
##
|
194
208
|
# @return {PvP}
|
195
209
|
def self.pvp
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BlizzardApi
|
4
|
+
module Wow
|
5
|
+
##
|
6
|
+
# This class allows access to World of Warcraft azerite essences
|
7
|
+
#
|
8
|
+
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-game-data-api
|
9
|
+
#
|
10
|
+
# You can get an instance of this class using the default region as follows:
|
11
|
+
# api_instance = BlizzardApi::Wow.azerite_essence
|
12
|
+
class AzeriteEssence < Wow::GenericDataEndpoint
|
13
|
+
protected
|
14
|
+
|
15
|
+
def endpoint_setup
|
16
|
+
@endpoint = 'azerite-essence'
|
17
|
+
@namespace = endpoint_namespace :static
|
18
|
+
@collection = 'azerite_essences'
|
19
|
+
@ttl = CACHE_TRIMESTER
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BlizzardApi
|
4
|
+
module Wow
|
5
|
+
##
|
6
|
+
# This class allows access to World of Warcraft item data
|
7
|
+
#
|
8
|
+
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
|
9
|
+
#
|
10
|
+
# You can get an instance of this class using the default region as follows:
|
11
|
+
# api_instance = BlizzardApi::Wow.item
|
12
|
+
class Item < Wow::GenericDataEndpoint
|
13
|
+
##
|
14
|
+
# This method overrides the inherited default behavior to prevent high server load and fetch time
|
15
|
+
#
|
16
|
+
# @!macro response
|
17
|
+
def index
|
18
|
+
raise BlizzardApi::ApiException, 'This endpoint does not have a index method'
|
19
|
+
end
|
20
|
+
|
21
|
+
##
|
22
|
+
# This method overrides the inherited default behavior to prevent high server load and fetch time
|
23
|
+
#
|
24
|
+
# @!macro response
|
25
|
+
def complete
|
26
|
+
raise BlizzardApi::ApiException, 'This endpoint does not have a complete method'
|
27
|
+
end
|
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
|
+
#
|
37
|
+
# @!macro response
|
38
|
+
def get(id, options = {})
|
39
|
+
return super id, options unless options.include? :use_community_endpoint
|
40
|
+
|
41
|
+
api_request "#{base_url(:community)}/item/#{id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Return complete data of an item set by id
|
46
|
+
#
|
47
|
+
# @param set_id [Integer] Item set id
|
48
|
+
# @!macro request_options
|
49
|
+
#
|
50
|
+
# @!macro response
|
51
|
+
def item_set(set_id, options = {})
|
52
|
+
api_request "#{base_url(:community)}/item/set/#{set_id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# Return a list of item classes
|
57
|
+
#
|
58
|
+
# @!macro request_options
|
59
|
+
# @option options [Boolean] :use_community_endpoint If set to true, this method will call the community endpoint
|
60
|
+
# instead of the data endpoint https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
|
61
|
+
#
|
62
|
+
# @!macro response
|
63
|
+
def classes(options = {})
|
64
|
+
if options.include? :use_community_endpoint
|
65
|
+
return api_request "#{base_url(:community)}/data/item/classes", { ttl: CACHE_TRIMESTER }.merge(options)
|
66
|
+
end
|
67
|
+
|
68
|
+
api_request "#{endpoint_uri('class')}/index", default_options.merge(options)
|
69
|
+
end
|
70
|
+
|
71
|
+
##
|
72
|
+
# Return data about an item class
|
73
|
+
#
|
74
|
+
# @param id [Integer] Item class id
|
75
|
+
# @!macro request_options
|
76
|
+
#
|
77
|
+
# @!macro response
|
78
|
+
def class(id, options = {})
|
79
|
+
api_request "#{endpoint_uri('class')}/#{id}", default_options.merge(options)
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Return all subclasses of a given class
|
84
|
+
#
|
85
|
+
# @param id [Integer] Item class id
|
86
|
+
# @param subclass_id [Integer] Item subclass id
|
87
|
+
# @!macro request_options
|
88
|
+
#
|
89
|
+
# @!macro response
|
90
|
+
def subclass(id, subclass_id, options = {})
|
91
|
+
api_request "#{endpoint_uri('class')}/#{id}/item-subclass/#{subclass_id}", default_options.merge(options)
|
92
|
+
end
|
93
|
+
|
94
|
+
protected
|
95
|
+
|
96
|
+
def endpoint_setup
|
97
|
+
@endpoint = 'item'
|
98
|
+
@namespace = endpoint_namespace :static
|
99
|
+
@collection = 'items'
|
100
|
+
@ttl = CACHE_TRIMESTER
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BlizzardApi
|
4
|
+
module Wow
|
5
|
+
##
|
6
|
+
# This class allows access to World of Warcraft titles
|
7
|
+
#
|
8
|
+
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-game-data-api
|
9
|
+
#
|
10
|
+
# You can get an instance of this class using the default region as follows:
|
11
|
+
# api_instance = BlizzardApi::Wow.title
|
12
|
+
class Title < Wow::GenericDataEndpoint
|
13
|
+
##
|
14
|
+
# This method overrides the inherited default behavior to prevent high server load and fetch time
|
15
|
+
#
|
16
|
+
# @!macro response
|
17
|
+
def complete
|
18
|
+
raise BlizzardApi::ApiException, 'There are too many achievements to fetch complete data'
|
19
|
+
end
|
20
|
+
|
21
|
+
protected
|
22
|
+
|
23
|
+
def endpoint_setup
|
24
|
+
@endpoint = 'title'
|
25
|
+
@namespace = endpoint_namespace :static
|
26
|
+
@collection = 'titles'
|
27
|
+
@ttl = CACHE_TRIMESTER
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blizzard_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francis Schiavo
|
@@ -149,18 +149,19 @@ files:
|
|
149
149
|
- lib/blizzard_api/wow/community/boss.rb
|
150
150
|
- lib/blizzard_api/wow/community/challenge.rb
|
151
151
|
- lib/blizzard_api/wow/community/character.rb
|
152
|
-
- lib/blizzard_api/wow/community/item.rb
|
153
152
|
- lib/blizzard_api/wow/community/pvp.rb
|
154
153
|
- lib/blizzard_api/wow/community/quest.rb
|
155
154
|
- lib/blizzard_api/wow/community/recipe.rb
|
156
155
|
- lib/blizzard_api/wow/community/spell.rb
|
157
156
|
- lib/blizzard_api/wow/community/zone.rb
|
158
157
|
- lib/blizzard_api/wow/game_data/achievement.rb
|
158
|
+
- lib/blizzard_api/wow/game_data/azerite_essence.rb
|
159
159
|
- lib/blizzard_api/wow/game_data/connected_realm.rb
|
160
160
|
- lib/blizzard_api/wow/game_data/creature.rb
|
161
161
|
- lib/blizzard_api/wow/game_data/generic_data_endpoint.rb
|
162
162
|
- lib/blizzard_api/wow/game_data/guild.rb
|
163
163
|
- lib/blizzard_api/wow/game_data/guild_crest.rb
|
164
|
+
- lib/blizzard_api/wow/game_data/item.rb
|
164
165
|
- lib/blizzard_api/wow/game_data/mount.rb
|
165
166
|
- lib/blizzard_api/wow/game_data/mythic_keystone.rb
|
166
167
|
- lib/blizzard_api/wow/game_data/mythic_keystone_affix.rb
|
@@ -175,6 +176,7 @@ files:
|
|
175
176
|
- lib/blizzard_api/wow/game_data/race.rb
|
176
177
|
- lib/blizzard_api/wow/game_data/realm.rb
|
177
178
|
- lib/blizzard_api/wow/game_data/region.rb
|
179
|
+
- lib/blizzard_api/wow/game_data/title.rb
|
178
180
|
- lib/blizzard_api/wow/game_data/wow_token.rb
|
179
181
|
- lib/blizzard_api/wow/profile/character_profile.rb
|
180
182
|
- lib/blizzard_api/wow/request.rb
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BlizzardApi
|
4
|
-
module Wow
|
5
|
-
##
|
6
|
-
# This class allows access to World of Warcraft item data
|
7
|
-
#
|
8
|
-
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
|
9
|
-
#
|
10
|
-
# You can get an instance of this class using the default region as follows:
|
11
|
-
# api_instance = BlizzardApi::Wow.item
|
12
|
-
class Item < Wow::Request
|
13
|
-
##
|
14
|
-
# Return complete data of an item by id
|
15
|
-
#
|
16
|
-
# @param id [Integer] Item id
|
17
|
-
# @!macro request_options
|
18
|
-
#
|
19
|
-
# @!macro response
|
20
|
-
def get(id, options = {})
|
21
|
-
api_request "#{base_url(:community)}/item/#{id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
22
|
-
end
|
23
|
-
|
24
|
-
##
|
25
|
-
# Return complete data of an item set by id
|
26
|
-
#
|
27
|
-
# @param set_id [Integer] Item set id
|
28
|
-
# @!macro request_options
|
29
|
-
#
|
30
|
-
# @!macro response
|
31
|
-
def item_set(set_id, options = {})
|
32
|
-
api_request "#{base_url(:community)}/item/set/#{set_id}", { ttl: CACHE_TRIMESTER }.merge(options)
|
33
|
-
end
|
34
|
-
|
35
|
-
##
|
36
|
-
# Return a list of item classes
|
37
|
-
#
|
38
|
-
# @!macro request_options
|
39
|
-
#
|
40
|
-
# @!macro response
|
41
|
-
def classes(options = {})
|
42
|
-
api_request "#{base_url(:community)}/data/item/classes", { ttl: CACHE_TRIMESTER }.merge(options)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|