blizzard_api 3.3.0 → 3.4.1

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
  SHA256:
3
- metadata.gz: 20cf33fde29710b0f5c1c24e5e2c7001c42a25997175def8f3e02ed7742a4b62
4
- data.tar.gz: f95f37b65054229c5fa4091a53cbbd31c20a4901282c78e4b37e07dd24636b69
3
+ metadata.gz: 5c512afdd4603e21f9e0f69320bea3ee1217050c7529979453c4e5196ebae26d
4
+ data.tar.gz: 54bf6ae69b29b36b7522072c5feadfc47255184b1a2e00acae842373d7711917
5
5
  SHA512:
6
- metadata.gz: d9cea099795510ba35524d15a4a77af940ba8bce410646f23b4ead61ba423b6c5567ad0804c3115fa523dc85da33d2643d87e980e4a4b4b59768c8ea45c91cc2
7
- data.tar.gz: 68a150c0d4c39e86654087e6609e20809cb5971b0cdc2f26c9553ddb7089bb61ad30b33ce3661651cb7887e8d44c5445c75a0b0df3e277dc9ed74542d7626b6c
6
+ metadata.gz: 0e1bf5df8fb0171d4347b35ecf5f40441ddf430f30feb62b9d0f250fc88b14abbc6649ad150e6a2a5f8f49ae71129eeff0f394433a247fa7cb5a281c8ae120a1
7
+ data.tar.gz: befe1a4fb05362cd1f7cf67aa5d0d59ea14e1eb00d7455c2d7558322fe65a0c51e7339a5d9e9178aefacf654f45915e34034cbba8df53597ed8003df8e72dcd0
@@ -19,3 +19,4 @@ jobs:
19
19
  BNET_APPLICATION_ID: ${{ secrets.BNET_APPLICATION_ID }}
20
20
  BNET_APPLICATION_SECRET: ${{ secrets.BNET_APPLICATION_SECRET }}
21
21
  USE_CACHE: false
22
+ IGNORE_CLASSIC_TESTS: true
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  Please view this file on the master branch, otherwise it may be outdated
2
2
 
3
+ **Version 3.4.0**
4
+
5
+ Added new collections endpoints for toys and heirlooms.
6
+
7
+ **Version 3.2.0**
8
+
9
+ Added new WoW Dragonflight talents endpoint.
10
+ Added support for Overwatch League API
11
+
3
12
  **Version 3.2.0**
4
13
 
5
14
  Added new AH commodities endpoint.
@@ -257,4 +266,4 @@ https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-api-update-collec
257
266
  * Lots of improvements to WoW endpoints
258
267
 
259
268
  **Version 0.1.0**
260
- * Initial release
269
+ * Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blizzard_api (3.3.0)
4
+ blizzard_api (3.4.1)
5
5
  redis (~> 4.1, >= 4.1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -129,6 +129,7 @@ end
129
129
  * [BlizzardApi::Wow.covenant](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Covenant)
130
130
  * [BlizzardApi::Wow.creature](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Creature)
131
131
  * [BlizzardApi::Wow.guild_crest](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/GuildCrest)
132
+ * [BlizzardApi::Wow.heirloom](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Heirloom)
132
133
  * [BlizzardApi::Wow.item](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Item)
133
134
  * [BlizzardApi::Wow.journal](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Journal)
134
135
  * [BlizzardApi::Wow.media](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Media)
@@ -154,6 +155,7 @@ end
154
155
  * [BlizzardApi::Wow.talent](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Talent)
155
156
  * [BlizzardApi::Wow.tech_talent](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/TechTalent)
156
157
  * [BlizzardApi::Wow.title](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Title)
158
+ * [BlizzardApi::Wow.toy](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Toy)
157
159
  * [BlizzardApi::Wow.wow_token](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/WowToken)
158
160
 
159
161
  * [BlizzardApi::Wow.profile](https://rubydoc.info/gems/blizzard_api/BlizzardApi/Wow/Profile)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module BlizzardApi
4
4
  # Gem version
5
- VERSION = '3.3.0'
5
+ VERSION = '3.4.1'
6
6
  end
@@ -15,7 +15,7 @@ module BlizzardApi
15
15
  setup 'creature', :static, CACHE_TRIMESTER
16
16
 
17
17
  def index
18
- raise BlizzardApi::ApiException, 'Creatures endpoint doesn\'t have an index method'
18
+ raise BlizzardApi::ApiException, 'Creatures endpoint does not have an index method'
19
19
  end
20
20
 
21
21
  ##
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module Wow
5
+ ##
6
+ # This class allows access to World of Warcraft heirloom data
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.heirloom
12
+ class Heirloom < Wow::GenericDataEndpoint
13
+ setup 'heirloom', :static, CACHE_TRIMESTER
14
+ end
15
+ end
16
+ end
@@ -33,6 +33,7 @@ module BlizzardApi
33
33
  def classes(**options)
34
34
  api_request "#{endpoint_uri('class')}/index", **default_options.merge(options)
35
35
  end
36
+ alias item_classes classes
36
37
 
37
38
  ##
38
39
  # Return data about an item class
@@ -60,6 +61,7 @@ module BlizzardApi
60
61
  def subclass(id, subclass_id, **options)
61
62
  api_request "#{endpoint_uri('class')}/#{id}/item-subclass/#{subclass_id}", **default_options.merge(options)
62
63
  end
64
+ alias item_subclass subclass
63
65
 
64
66
  ##
65
67
  # Fetch media for an item using its *id*
@@ -12,6 +12,10 @@ module BlizzardApi
12
12
  class ModifiedCrafting < Wow::GenericDataEndpoint
13
13
  setup 'modified-crafting', :static, CACHE_TRIMESTER
14
14
 
15
+ def get(_id, **_options)
16
+ raise BlizzardApi::ApiException, 'This endpoint does not have a get method'
17
+ end
18
+
15
19
  ##
16
20
  # Fetch modified crafting category index
17
21
  #
@@ -58,7 +58,7 @@ module BlizzardApi
58
58
 
59
59
  def resolve_icon(media_url)
60
60
  media_data = api_request(media_url)
61
- media_data[:assets][0][:value]
61
+ media_data.dig(:assets, 0, :value)
62
62
  end
63
63
  end
64
64
  end
@@ -33,7 +33,20 @@ module BlizzardApi
33
33
  #
34
34
  # @!macro response
35
35
  def talent_tree(talent_tree_id, spec_id, **options)
36
- api_request "#{base_url(:game_data)}/talent-tree/#{talent_tree_id}/playable-specialization/#{spec_id}", **default_options.merge(options)
36
+ api_request "#{base_url(:game_data)}/talent-tree/#{talent_tree_id}/playable-specialization/#{spec_id}",
37
+ **default_options.merge(options)
38
+ end
39
+
40
+ ##
41
+ # Fetch a talent tree node
42
+ #
43
+ # @param talent_tree_id [Integer] talent tree id
44
+ #
45
+ # @!macro request_options
46
+ #
47
+ # @!macro response
48
+ def talent_tree_nodes(talent_tree_id, **options)
49
+ api_request "#{base_url(:game_data)}/talent-tree/#{talent_tree_id}", **default_options.merge(options)
37
50
  end
38
51
 
39
52
  ##
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module Wow
5
+ ##
6
+ # This class allows access to World of Warcraft toys
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.toy
12
+ class Toy < Wow::GenericDataEndpoint
13
+ setup 'toy', :static, CACHE_TRIMESTER
14
+ end
15
+ end
16
+ end
@@ -52,6 +52,26 @@ module BlizzardApi
52
52
  api_request "#{base_url(:user_profile)}/collections/mounts", **default_options.merge(options)
53
53
  end
54
54
 
55
+ ##
56
+ # Returns the toy collection index for the account
57
+ #
58
+ # @!macro request_options
59
+ #
60
+ # @!macro response
61
+ def toys(**options)
62
+ api_request "#{base_url(:user_profile)}/collections/toys", **default_options.merge(options)
63
+ end
64
+
65
+ ##
66
+ # Returns the heirloom collection index for the account
67
+ #
68
+ # @!macro request_options
69
+ #
70
+ # @!macro response
71
+ def heirloom(**options)
72
+ api_request "#{base_url(:user_profile)}/collections/heirloom", **default_options.merge(options)
73
+ end
74
+
55
75
  ##
56
76
  # Returns the pet collection index for the account
57
77
  #
@@ -110,6 +110,34 @@ module BlizzardApi
110
110
  character_request realm, character, 'collections/mounts', **options
111
111
  end
112
112
 
113
+ ##
114
+ # Return a character's toy collection
115
+ #
116
+ # @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
117
+ #
118
+ # @param realm [String] The character realm's slug
119
+ # @param character [String] The character name
120
+ # @!macro request_options
121
+ #
122
+ # @!macro response
123
+ def toys(realm, character, **options)
124
+ character_request realm, character, 'collections/toys', **options
125
+ end
126
+
127
+ ##
128
+ # Return a character's heirloom collection
129
+ #
130
+ # @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
131
+ #
132
+ # @param realm [String] The character realm's slug
133
+ # @param character [String] The character name
134
+ # @!macro request_options
135
+ #
136
+ # @!macro response
137
+ def heirlooms(realm, character, **options)
138
+ character_request realm, character, 'collections/heirlooms', **options
139
+ end
140
+
113
141
  ##
114
142
  # Return a character's encounter summary
115
143
  #
@@ -23,6 +23,7 @@ module BlizzardApi
23
23
  require_relative 'wow/game_data/covenant'
24
24
  require_relative 'wow/game_data/creature'
25
25
  require_relative 'wow/game_data/guild_crest'
26
+ require_relative 'wow/game_data/heirloom'
26
27
  require_relative 'wow/game_data/item'
27
28
  require_relative 'wow/game_data/journal'
28
29
  require_relative 'wow/game_data/media'
@@ -49,6 +50,7 @@ module BlizzardApi
49
50
  require_relative 'wow/game_data/talent'
50
51
  require_relative 'wow/game_data/tech_talent'
51
52
  require_relative 'wow/game_data/title'
53
+ require_relative 'wow/game_data/toy'
52
54
  require_relative 'wow/game_data/wow_token'
53
55
 
54
56
  ##
@@ -100,6 +102,13 @@ module BlizzardApi
100
102
  BlizzardApi::Wow::GuildCrest.new(**options)
101
103
  end
102
104
 
105
+ ##
106
+ # @!macro init_options
107
+ # @return {Heirloom}
108
+ def self.heirloom(**options)
109
+ BlizzardApi::Wow::Heirloom.new(**options)
110
+ end
111
+
103
112
  ##
104
113
  # @!macro init_options
105
114
  # @return {Item}
@@ -282,6 +291,13 @@ module BlizzardApi
282
291
  BlizzardApi::Wow::Title.new(**options)
283
292
  end
284
293
 
294
+ ##
295
+ # @!macro init_options
296
+ # @return {Toy}
297
+ def self.toy(**options)
298
+ BlizzardApi::Wow::Toy.new(**options)
299
+ end
300
+
285
301
  ##
286
302
  # @!macro init_options
287
303
  # @return {WowToken}
@@ -289,7 +305,7 @@ module BlizzardApi
289
305
  BlizzardApi::Wow::WowToken.new(**options)
290
306
  end
291
307
 
292
- require_relative 'wow/profile/profile'
308
+ require_relative 'wow/profile/account_profile'
293
309
  require_relative 'wow/profile/guild'
294
310
  require_relative 'wow/profile/character_profile'
295
311
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blizzard_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Schiavo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-29 00:00:00.000000000 Z
11
+ date: 2023-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -170,6 +170,7 @@ files:
170
170
  - lib/blizzard_api/wow/game_data/creature.rb
171
171
  - lib/blizzard_api/wow/game_data/generic_data_endpoint.rb
172
172
  - lib/blizzard_api/wow/game_data/guild_crest.rb
173
+ - lib/blizzard_api/wow/game_data/heirloom.rb
173
174
  - lib/blizzard_api/wow/game_data/item.rb
174
175
  - lib/blizzard_api/wow/game_data/journal.rb
175
176
  - lib/blizzard_api/wow/game_data/media.rb
@@ -196,10 +197,11 @@ files:
196
197
  - lib/blizzard_api/wow/game_data/talent.rb
197
198
  - lib/blizzard_api/wow/game_data/tech_talent.rb
198
199
  - lib/blizzard_api/wow/game_data/title.rb
200
+ - lib/blizzard_api/wow/game_data/toy.rb
199
201
  - lib/blizzard_api/wow/game_data/wow_token.rb
202
+ - lib/blizzard_api/wow/profile/account_profile.rb
200
203
  - lib/blizzard_api/wow/profile/character_profile.rb
201
204
  - lib/blizzard_api/wow/profile/guild.rb
202
- - lib/blizzard_api/wow/profile/profile.rb
203
205
  - lib/blizzard_api/wow/request.rb
204
206
  - lib/blizzard_api/wow/search/search_composer.rb
205
207
  - lib/blizzard_api/wow/search/search_request.rb