blizzard_api 3.2.0 → 3.4.0

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
  SHA256:
3
- metadata.gz: ba8374332ff5b57727b9b5528294f71c723b617fc863672f2cc1673c8a1f1537
4
- data.tar.gz: 29b16eee7787cfc7a5e53d3274a829b49db727ca106e9e1f53a0867a1a81b188
3
+ metadata.gz: 3a312449c62a1d6f9f0905e1b13009ec8f6f9c0153e843ceccff71ce20572dd2
4
+ data.tar.gz: 3917df7bb6af320e2ce5cdd41e0f5309b43550a4f032a8d3e09be984f3fd9351
5
5
  SHA512:
6
- metadata.gz: e2f2dfff1fed002b4ee9ac408a59a675d175c0effbc04fd39d3aac55b29802cc5db9d9d563528b2349724111191f7d0eddd15f696c2c67399a3df05875ffa6d5
7
- data.tar.gz: 335ccfcdebdcfc92c345c11a0da1330092fdc55a5cc0a7927a4099ae37f838673a1b2ad6fbd29b9aa0b05f9274049d8e38a653379054cecb29259af2b395290c
6
+ metadata.gz: 1b5a43dc799bdfcf902da78605b5d3308f651910d1cd01d6819648087235a1f4f4f65def824f192bd0a0d1efc13baad42d6ce20c753edfa0977263b352b937c7
7
+ data.tar.gz: b7c9a62af171bb7748d8d09325cdb1b38c377b1404dbcbdcda9280cee3c4418c1b1ed1b3aabc25df43d97d0e431322490821e13f101ca75d3a0623a1118f72ff
@@ -8,9 +8,9 @@ jobs:
8
8
  steps:
9
9
  - uses: actions/checkout@v2
10
10
  - name: Set up Ruby
11
- uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
11
+ uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
12
12
  with:
13
- ruby-version: 3.0.0-preview1
13
+ ruby-version: 3.1
14
14
  - name: Install dependencies
15
15
  run: bundle install
16
16
  - name: Run tests
@@ -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,22 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blizzard_api (3.1.0)
4
+ blizzard_api (3.4.0)
5
5
  redis (~> 4.1, >= 4.1.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
- dotenv (2.7.6)
12
- minitest (5.15.0)
13
- parallel (1.21.0)
14
- parser (3.0.3.2)
11
+ dotenv (2.8.1)
12
+ minitest (5.16.3)
13
+ parallel (1.22.1)
14
+ parser (3.1.3.0)
15
15
  ast (~> 2.4.1)
16
- rainbow (3.0.0)
16
+ rainbow (3.1.1)
17
17
  rake (13.0.6)
18
- redis (4.5.1)
19
- regexp_parser (2.2.0)
18
+ redis (4.8.0)
19
+ regexp_parser (2.6.1)
20
20
  rexml (3.2.5)
21
21
  rubocop (0.93.1)
22
22
  parallel (~> 1.10)
@@ -27,12 +27,12 @@ GEM
27
27
  rubocop-ast (>= 0.6.0)
28
28
  ruby-progressbar (~> 1.7)
29
29
  unicode-display_width (>= 1.4.0, < 2.0)
30
- rubocop-ast (1.15.1)
31
- parser (>= 3.0.1.1)
30
+ rubocop-ast (1.24.0)
31
+ parser (>= 3.1.1.0)
32
32
  ruby-progressbar (1.11.0)
33
33
  unicode-display_width (1.8.0)
34
34
  webrick (1.7.0)
35
- yard (0.9.27)
35
+ yard (0.9.28)
36
36
  webrick (~> 1.7.0)
37
37
 
38
38
  PLATFORMS
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)
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module OverwatchLeague
5
+ ##
6
+ # This class allows access to OWL2 match data
7
+ #
8
+ # @see https://develop.battle.net/documentation/owl/community-apis
9
+ #
10
+ # You can get an instance of this class using the default region as follows:
11
+ # api_instance = BlizzardApi::OverwatchLeague.matches
12
+ class Matches < OverwatchLeague::Request
13
+ ##
14
+ # Returns match information
15
+ #
16
+ # @!macro request_options
17
+ def get(match_id, **options)
18
+ api_request "#{base_url(:community)}/v1/matches/#{match_id}", **{ ttl: CACHE_DAY }.merge(options)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module OverwatchLeague
5
+ ##
6
+ # This class allows access to OWL2 player data
7
+ #
8
+ # @see https://develop.battle.net/documentation/owl/community-apis
9
+ #
10
+ # You can get an instance of this class using the default region as follows:
11
+ # api_instance = BlizzardApi::OverwatchLeague.players
12
+ class Players < OverwatchLeague::Request
13
+ ##
14
+ # Returns player information
15
+ #
16
+ # @!macro request_options
17
+ def get(player_id, **options)
18
+ api_request "#{base_url(:community)}/v1/players/#{player_id}", **{ ttl: CACHE_DAY }.merge(options)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module OverwatchLeague
5
+ ##
6
+ # This class allows access to OWL2 segment data
7
+ #
8
+ # @see https://develop.battle.net/documentation/owl/community-apis
9
+ #
10
+ # You can get an instance of this class using the default region as follows:
11
+ # api_instance = BlizzardApi::OverwatchLeague.segments
12
+ class Segments < OverwatchLeague::Request
13
+ ##
14
+ # Returns segment information
15
+ #
16
+ # @!macro request_options
17
+ def get(segment_id, **options)
18
+ api_request "#{base_url(:community)}/v1/segments/#{segment_id}", **{ ttl: CACHE_DAY }.merge(options)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module OverwatchLeague
5
+ ##
6
+ # This class allows access to OWL2 summary data
7
+ #
8
+ # @see https://develop.battle.net/documentation/owl/community-apis
9
+ #
10
+ # You can get an instance of this class using the default region as follows:
11
+ # api_instance = BlizzardApi::OverwatchLeague.summary
12
+ class Summary < OverwatchLeague::Request
13
+ ##
14
+ # Returns summary information
15
+ #
16
+ # @!macro request_options
17
+ def get(**options)
18
+ api_request "#{base_url(:community)}/v1/owl2", **{ ttl: CACHE_DAY }.merge(options)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module OverwatchLeague
5
+ ##
6
+ # This class allows access to OWL2 team data
7
+ #
8
+ # @see https://develop.battle.net/documentation/owl/community-apis
9
+ #
10
+ # You can get an instance of this class using the default region as follows:
11
+ # api_instance = BlizzardApi::OverwatchLeague.teams
12
+ class Teams < OverwatchLeague::Request
13
+ ##
14
+ # Returns team information
15
+ #
16
+ # @!macro request_options
17
+ def get(team_id, **options)
18
+ api_request "#{base_url(:community)}/v1/teams/#{team_id}", **{ ttl: CACHE_DAY }.merge(options)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module OverwatchLeague
5
+ # Overwatch League requests
6
+ class Request < BlizzardApi::Request
7
+ ##
8
+ # @!macro init_options
9
+ def initialize(**options)
10
+ super(**options)
11
+ @game = 'owl'
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ # Overwatch League related classes
5
+ module OverwatchLeague
6
+ require_relative 'overwatch_league/request'
7
+
8
+ # Overwatch League community api
9
+ require_relative 'overwatch_league/community/summary'
10
+ require_relative 'overwatch_league/community/players'
11
+ require_relative 'overwatch_league/community/matches'
12
+ require_relative 'overwatch_league/community/segments'
13
+ require_relative 'overwatch_league/community/teams'
14
+
15
+ ##
16
+ # @!macro init_options
17
+ # @return {Summary}
18
+ def self.summary(**options)
19
+ BlizzardApi::OverwatchLeague::Summary.new(**options)
20
+ end
21
+
22
+ ##
23
+ # @!macro init_options
24
+ # @return {Players}
25
+ def self.players(**options)
26
+ BlizzardApi::OverwatchLeague::Players.new(**options)
27
+ end
28
+
29
+ ##
30
+ # @!macro init_options
31
+ # @return {Matches}
32
+ def self.matches(**options)
33
+ BlizzardApi::OverwatchLeague::Matches.new(**options)
34
+ end
35
+
36
+ ##
37
+ # @!macro init_options
38
+ # @return {Segments}
39
+ def self.segments(**options)
40
+ BlizzardApi::OverwatchLeague::Segments.new(**options)
41
+ end
42
+
43
+ ##
44
+ # @!macro init_options
45
+ # @return {Teams}
46
+ def self.teams(**options)
47
+ BlizzardApi::OverwatchLeague::Teams.new(**options)
48
+ end
49
+ end
50
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module BlizzardApi
4
4
  # Gem version
5
- VERSION = '3.2.0'
5
+ VERSION = '3.4.0'
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
@@ -12,6 +12,43 @@ module BlizzardApi
12
12
  class Talent < Wow::GenericDataEndpoint
13
13
  setup 'talent', :static, CACHE_TRIMESTER
14
14
 
15
+ ##
16
+ # Fetch talent trees
17
+ #
18
+ # @!macro request_options
19
+ #
20
+ # @!macro response
21
+ def talent_trees(**options)
22
+ api_request "#{base_url(:game_data)}/talent-tree/index", **default_options.merge(options)
23
+ end
24
+
25
+ ##
26
+ # Fetch a talent tree
27
+ #
28
+ # @param talent_tree_id [Integer] talent tree id
29
+ #
30
+ # @param spec_id [Integer] playable specialization id
31
+ #
32
+ # @!macro request_options
33
+ #
34
+ # @!macro response
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}",
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)
50
+ end
51
+
15
52
  ##
16
53
  # Fetch pvp talents
17
54
  #
@@ -23,7 +60,7 @@ module BlizzardApi
23
60
  end
24
61
 
25
62
  ##
26
- # Fetch pvp a talent
63
+ # Fetch a pvp talent
27
64
  #
28
65
  # @param id [Integer] Pvp talent id
29
66
  #
@@ -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
@@ -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}
data/lib/blizzard_api.rb CHANGED
@@ -11,6 +11,7 @@ require_relative 'blizzard_api/wow'
11
11
  require_relative 'blizzard_api/diablo'
12
12
  require_relative 'blizzard_api/hearthstone'
13
13
  require_relative 'blizzard_api/starcraft'
14
+ require_relative 'blizzard_api/overwatch_league'
14
15
 
15
16
  # Blizzard namespace
16
17
  module BlizzardApi
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.2.0
4
+ version: 3.4.0
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-08-18 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -144,6 +144,13 @@ files:
144
144
  - lib/blizzard_api/hearthstone/game_data/generic_data_endpoint.rb
145
145
  - lib/blizzard_api/hearthstone/game_data/metadata.rb
146
146
  - lib/blizzard_api/hearthstone/request.rb
147
+ - lib/blizzard_api/overwatch_league.rb
148
+ - lib/blizzard_api/overwatch_league/community/matches.rb
149
+ - lib/blizzard_api/overwatch_league/community/players.rb
150
+ - lib/blizzard_api/overwatch_league/community/segments.rb
151
+ - lib/blizzard_api/overwatch_league/community/summary.rb
152
+ - lib/blizzard_api/overwatch_league/community/teams.rb
153
+ - lib/blizzard_api/overwatch_league/request.rb
147
154
  - lib/blizzard_api/request.rb
148
155
  - lib/blizzard_api/starcraft.rb
149
156
  - lib/blizzard_api/starcraft/community/account.rb
@@ -163,6 +170,7 @@ files:
163
170
  - lib/blizzard_api/wow/game_data/creature.rb
164
171
  - lib/blizzard_api/wow/game_data/generic_data_endpoint.rb
165
172
  - lib/blizzard_api/wow/game_data/guild_crest.rb
173
+ - lib/blizzard_api/wow/game_data/heirloom.rb
166
174
  - lib/blizzard_api/wow/game_data/item.rb
167
175
  - lib/blizzard_api/wow/game_data/journal.rb
168
176
  - lib/blizzard_api/wow/game_data/media.rb
@@ -189,6 +197,7 @@ files:
189
197
  - lib/blizzard_api/wow/game_data/talent.rb
190
198
  - lib/blizzard_api/wow/game_data/tech_talent.rb
191
199
  - lib/blizzard_api/wow/game_data/title.rb
200
+ - lib/blizzard_api/wow/game_data/toy.rb
192
201
  - lib/blizzard_api/wow/game_data/wow_token.rb
193
202
  - lib/blizzard_api/wow/profile/character_profile.rb
194
203
  - lib/blizzard_api/wow/profile/guild.rb
@@ -221,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
230
  - !ruby/object:Gem::Version
222
231
  version: '0'
223
232
  requirements: []
224
- rubygems_version: 3.1.4
233
+ rubygems_version: 3.3.7
225
234
  signing_key:
226
235
  specification_version: 4
227
236
  summary: Unofficial Ruby client for Blizzard Entertainment API