blizzard_api 0.3.7 → 0.3.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18b8829ee15345cbac3a2874955718a288bc75893fd8c7d282f30e3a176fd926
|
4
|
+
data.tar.gz: eeba67d5fd5fbd5a14e380ffc78ae35bc28f88668ca73601572a6441f95eaee1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45e0f9eb2c89426546dc2d29a8462ee1a471e2463c9d1ac0cbd4b4e5a8066894bfed65b720fcaa176954f2548dcdd0624ae7e022ff03ac9f86acd78929e65b47
|
7
|
+
data.tar.gz: f14afd42c690d863732156f588a87ae1977fcb68221e41b7289324aaa18ab21bcce84306469f2d37a9fab418db2e40b5a9eca6a32c2be8d7fadb42fcc5bf6a1b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
Please view this file on the master branch, otherwise it may be outdated
|
2
2
|
|
3
|
+
**Version 0.3.8**
|
4
|
+
Added new profession endpoints.
|
5
|
+
|
6
|
+
https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-api-patch-notes-20200414/5680
|
7
|
+
|
3
8
|
**Version 0.3.7**
|
4
9
|
|
5
10
|
Automated test improvements
|
data/lib/blizzard_api/version.rb
CHANGED
data/lib/blizzard_api/wow.rb
CHANGED
@@ -25,6 +25,7 @@ module BlizzardApi
|
|
25
25
|
require_relative 'wow/game_data/playable_race'
|
26
26
|
require_relative 'wow/game_data/playable_specialization'
|
27
27
|
require_relative 'wow/game_data/power_type'
|
28
|
+
require_relative 'wow/game_data/profession'
|
28
29
|
require_relative 'wow/game_data/pvp_season'
|
29
30
|
require_relative 'wow/game_data/pvp_tier'
|
30
31
|
require_relative 'wow/game_data/quest'
|
@@ -162,6 +163,13 @@ module BlizzardApi
|
|
162
163
|
BlizzardApi::Wow::PowerType.new(region)
|
163
164
|
end
|
164
165
|
|
166
|
+
##
|
167
|
+
# @param region [String] API Region
|
168
|
+
# @return {Profession}
|
169
|
+
def self.profession(region = BlizzardApi.region)
|
170
|
+
BlizzardApi::Wow::Profession.new(region)
|
171
|
+
end
|
172
|
+
|
165
173
|
##
|
166
174
|
# @param region [String] API Region
|
167
175
|
# @return {PvpSeason}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BlizzardApi
|
4
|
+
module Wow
|
5
|
+
##
|
6
|
+
# This class allows access to World of Warcraft professions
|
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.profession
|
12
|
+
class Profession < Wow::GenericDataEndpoint
|
13
|
+
##
|
14
|
+
# Fetch media for a profession using its *id*
|
15
|
+
#
|
16
|
+
# @param id [Integer] Profession id
|
17
|
+
#
|
18
|
+
# @!macro request_options
|
19
|
+
#
|
20
|
+
# @!macro response
|
21
|
+
def media(id, options = {})
|
22
|
+
api_request "#{base_url(:media)}/profession/#{id}", default_options.merge(options)
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Fetch skill tier for a profession using its *ids*
|
27
|
+
#
|
28
|
+
# @param id [Integer] Profession id
|
29
|
+
# @param tier_id [Integer] Profession skill tier id
|
30
|
+
#
|
31
|
+
# @!macro request_options
|
32
|
+
#
|
33
|
+
# @!macro response
|
34
|
+
def skill_tier(id, tier_id, options = {})
|
35
|
+
api_request "#{base_url(:game_data)}/profession/#{id}/skill-tier/#{tier_id}", default_options.merge(options)
|
36
|
+
end
|
37
|
+
|
38
|
+
##
|
39
|
+
# Fetch data for a recipe using its *ids*
|
40
|
+
#
|
41
|
+
# @param id [Integer] Recipe id
|
42
|
+
#
|
43
|
+
# @!macro request_options
|
44
|
+
#
|
45
|
+
# @!macro response
|
46
|
+
def recipe(id, options = {})
|
47
|
+
api_request "#{base_url(:game_data)}/recipe/#{id}", default_options.merge(options)
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Fetch media for a recipe using its *ids*
|
52
|
+
#
|
53
|
+
# @param id [Integer] Recipe id
|
54
|
+
#
|
55
|
+
# @!macro request_options
|
56
|
+
#
|
57
|
+
# @!macro response
|
58
|
+
def recipe_media(id, options = {})
|
59
|
+
api_request "#{base_url(:media)}/recipe/#{id}", default_options.merge(options)
|
60
|
+
end
|
61
|
+
|
62
|
+
protected
|
63
|
+
|
64
|
+
def endpoint_setup
|
65
|
+
@endpoint = 'profession'
|
66
|
+
@namespace = :static
|
67
|
+
@collection = 'professions'
|
68
|
+
@ttl = CACHE_TRIMESTER
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -221,6 +221,20 @@ module BlizzardApi
|
|
221
221
|
character_request realm, character, options, "mythic-keystone-profile/season/#{season}"
|
222
222
|
end
|
223
223
|
|
224
|
+
##
|
225
|
+
# Return professions from a character
|
226
|
+
#
|
227
|
+
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
|
228
|
+
#
|
229
|
+
# @param realm [String] The character realm's slug
|
230
|
+
# @param character [String] The character name
|
231
|
+
# @!macro request_options
|
232
|
+
#
|
233
|
+
# @!macro response
|
234
|
+
def professions(realm, character, options = {})
|
235
|
+
character_request realm, character, options, 'professions'
|
236
|
+
end
|
237
|
+
|
224
238
|
##
|
225
239
|
# Return character status
|
226
240
|
#
|
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: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francis Schiavo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- lib/blizzard_api/wow/game_data/playable_race.rb
|
143
143
|
- lib/blizzard_api/wow/game_data/playable_specialization.rb
|
144
144
|
- lib/blizzard_api/wow/game_data/power_type.rb
|
145
|
+
- lib/blizzard_api/wow/game_data/profession.rb
|
145
146
|
- lib/blizzard_api/wow/game_data/pvp_season.rb
|
146
147
|
- lib/blizzard_api/wow/game_data/pvp_tier.rb
|
147
148
|
- lib/blizzard_api/wow/game_data/quest.rb
|