blizzard_api_rb_rb 3.4.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.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ruby.yml +22 -0
  3. data/.gitignore +12 -0
  4. data/.rubocop.yml +18 -0
  5. data/.rubocop_todo.yml +7 -0
  6. data/CHANGELOG.md +269 -0
  7. data/Gemfile +8 -0
  8. data/Gemfile.lock +50 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +200 -0
  11. data/Rakefile +12 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/blizzard_api_rb.gemspec +44 -0
  15. data/lib/blizzard_api_rb/api_response.rb +27 -0
  16. data/lib/blizzard_api_rb/api_standards.rb +55 -0
  17. data/lib/blizzard_api_rb/configuration.rb +93 -0
  18. data/lib/blizzard_api_rb/diablo/community/act.rb +35 -0
  19. data/lib/blizzard_api_rb/diablo/community/artisan.rb +38 -0
  20. data/lib/blizzard_api_rb/diablo/community/character_class.rb +38 -0
  21. data/lib/blizzard_api_rb/diablo/community/follower.rb +25 -0
  22. data/lib/blizzard_api_rb/diablo/community/item.rb +25 -0
  23. data/lib/blizzard_api_rb/diablo/community/item_type.rb +35 -0
  24. data/lib/blizzard_api_rb/diablo/community/profile.rb +83 -0
  25. data/lib/blizzard_api_rb/diablo/game_data/era.rb +21 -0
  26. data/lib/blizzard_api_rb/diablo/game_data/generic_data_endpoint.rb +58 -0
  27. data/lib/blizzard_api_rb/diablo/game_data/season.rb +21 -0
  28. data/lib/blizzard_api_rb/diablo/request.rb +15 -0
  29. data/lib/blizzard_api_rb/diablo.rb +91 -0
  30. data/lib/blizzard_api_rb/exception.rb +14 -0
  31. data/lib/blizzard_api_rb/hearthstone/game_data/back.rb +59 -0
  32. data/lib/blizzard_api_rb/hearthstone/game_data/card.rb +111 -0
  33. data/lib/blizzard_api_rb/hearthstone/game_data/deck.rb +30 -0
  34. data/lib/blizzard_api_rb/hearthstone/game_data/generic_data_endpoint.rb +49 -0
  35. data/lib/blizzard_api_rb/hearthstone/game_data/metadata.rb +22 -0
  36. data/lib/blizzard_api_rb/hearthstone/request.rb +15 -0
  37. data/lib/blizzard_api_rb/hearthstone.rb +49 -0
  38. data/lib/blizzard_api_rb/overwatch_league/community/matches.rb +22 -0
  39. data/lib/blizzard_api_rb/overwatch_league/community/players.rb +22 -0
  40. data/lib/blizzard_api_rb/overwatch_league/community/segments.rb +22 -0
  41. data/lib/blizzard_api_rb/overwatch_league/community/summary.rb +22 -0
  42. data/lib/blizzard_api_rb/overwatch_league/community/teams.rb +22 -0
  43. data/lib/blizzard_api_rb/overwatch_league/request.rb +15 -0
  44. data/lib/blizzard_api_rb/overwatch_league.rb +50 -0
  45. data/lib/blizzard_api_rb/request.rb +189 -0
  46. data/lib/blizzard_api_rb/starcraft/community/account.rb +23 -0
  47. data/lib/blizzard_api_rb/starcraft/community/ladder.rb +34 -0
  48. data/lib/blizzard_api_rb/starcraft/community/legacy.rb +87 -0
  49. data/lib/blizzard_api_rb/starcraft/community/profile.rb +76 -0
  50. data/lib/blizzard_api_rb/starcraft/game_data/league.rb +27 -0
  51. data/lib/blizzard_api_rb/starcraft/request.rb +36 -0
  52. data/lib/blizzard_api_rb/starcraft.rb +57 -0
  53. data/lib/blizzard_api_rb/token_manager.rb +49 -0
  54. data/lib/blizzard_api_rb/version.rb +6 -0
  55. data/lib/blizzard_api_rb/wow/game_data/achievement.rb +46 -0
  56. data/lib/blizzard_api_rb/wow/game_data/auction.rb +50 -0
  57. data/lib/blizzard_api_rb/wow/game_data/azerite_essence.rb +30 -0
  58. data/lib/blizzard_api_rb/wow/game_data/connected_realm.rb +18 -0
  59. data/lib/blizzard_api_rb/wow/game_data/covenant.rb +72 -0
  60. data/lib/blizzard_api_rb/wow/game_data/creature.rb +102 -0
  61. data/lib/blizzard_api_rb/wow/game_data/generic_data_endpoint.rb +50 -0
  62. data/lib/blizzard_api_rb/wow/game_data/guild_crest.rb +48 -0
  63. data/lib/blizzard_api_rb/wow/game_data/heirloom.rb +16 -0
  64. data/lib/blizzard_api_rb/wow/game_data/item.rb +102 -0
  65. data/lib/blizzard_api_rb/wow/game_data/journal.rb +110 -0
  66. data/lib/blizzard_api_rb/wow/game_data/media.rb +26 -0
  67. data/lib/blizzard_api_rb/wow/game_data/modified_crafting.rb +60 -0
  68. data/lib/blizzard_api_rb/wow/game_data/mount.rb +18 -0
  69. data/lib/blizzard_api_rb/wow/game_data/mythic_keystone.rb +86 -0
  70. data/lib/blizzard_api_rb/wow/game_data/mythic_keystone_affix.rb +28 -0
  71. data/lib/blizzard_api_rb/wow/game_data/mythic_keystone_leaderboard.rb +48 -0
  72. data/lib/blizzard_api_rb/wow/game_data/mythic_raid_leaderboard.rb +28 -0
  73. data/lib/blizzard_api_rb/wow/game_data/pet.rb +62 -0
  74. data/lib/blizzard_api_rb/wow/game_data/playable_class.rb +39 -0
  75. data/lib/blizzard_api_rb/wow/game_data/playable_race.rb +16 -0
  76. data/lib/blizzard_api_rb/wow/game_data/playable_specialization.rb +65 -0
  77. data/lib/blizzard_api_rb/wow/game_data/power_type.rb +16 -0
  78. data/lib/blizzard_api_rb/wow/game_data/profession.rb +65 -0
  79. data/lib/blizzard_api_rb/wow/game_data/pvp_region.rb +82 -0
  80. data/lib/blizzard_api_rb/wow/game_data/pvp_season.rb +53 -0
  81. data/lib/blizzard_api_rb/wow/game_data/pvp_tier.rb +26 -0
  82. data/lib/blizzard_api_rb/wow/game_data/quest.rb +79 -0
  83. data/lib/blizzard_api_rb/wow/game_data/realm.rb +18 -0
  84. data/lib/blizzard_api_rb/wow/game_data/region.rb +16 -0
  85. data/lib/blizzard_api_rb/wow/game_data/reputation.rb +74 -0
  86. data/lib/blizzard_api_rb/wow/game_data/spell.rb +38 -0
  87. data/lib/blizzard_api_rb/wow/game_data/talent.rb +75 -0
  88. data/lib/blizzard_api_rb/wow/game_data/tech_talent.rb +50 -0
  89. data/lib/blizzard_api_rb/wow/game_data/title.rb +16 -0
  90. data/lib/blizzard_api_rb/wow/game_data/toy.rb +16 -0
  91. data/lib/blizzard_api_rb/wow/game_data/wow_token.rb +20 -0
  92. data/lib/blizzard_api_rb/wow/profile/account_profile.rb +97 -0
  93. data/lib/blizzard_api_rb/wow/profile/character_profile.rb +415 -0
  94. data/lib/blizzard_api_rb/wow/profile/guild.rb +75 -0
  95. data/lib/blizzard_api_rb/wow/request.rb +16 -0
  96. data/lib/blizzard_api_rb/wow/search/search_composer.rb +97 -0
  97. data/lib/blizzard_api_rb/wow/search/search_request.rb +24 -0
  98. data/lib/blizzard_api_rb/wow/slug.rb +12 -0
  99. data/lib/blizzard_api_rb/wow.rb +335 -0
  100. data/lib/blizzard_api_rb.rb +26 -0
  101. metadata +237 -0
@@ -0,0 +1,30 @@
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
+ include BlizzardApi::Wow::Searchable
14
+
15
+ setup 'azerite-essence', :static, CACHE_TRIMESTER
16
+
17
+ ##
18
+ # Fetch media for one of the azerite essences listed by the {#index} using its *id*
19
+ #
20
+ # @param id [Integer] Azerite essence id
21
+ #
22
+ # @!macro request_options
23
+ #
24
+ # @!macro response
25
+ def media(id, **options)
26
+ api_request "#{base_url(:media)}/azerite-essence/#{id}", **default_options.merge(options)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module Wow
5
+ ##
6
+ # This class allows access to World of Warcraft connected realms
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.connected_realm
12
+ class ConnectedRealm < Wow::GenericDataEndpoint
13
+ include BlizzardApi::Wow::Searchable
14
+
15
+ setup 'connected-realm', :dynamic, CACHE_TRIMESTER
16
+ end
17
+ end
18
+ end
@@ -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 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 Covenant < Wow::GenericDataEndpoint
13
+ setup 'covenant', :static, CACHE_TRIMESTER
14
+
15
+ ##
16
+ # Fetch media for one of the covenants listed by the {#index} using its *id*
17
+ #
18
+ # @param id [Integer] Covenant id
19
+ #
20
+ # @!macro request_options
21
+ #
22
+ # @!macro response
23
+ def media(id, **options)
24
+ api_request "#{base_url(:media)}/covenant/#{id}", **default_options.merge(options)
25
+ end
26
+
27
+ ##
28
+ # Fetch all soulbinds
29
+ #
30
+ # @!macro request_options
31
+ #
32
+ # @!macro response
33
+ def soulbinds(**options)
34
+ api_request "#{base_url(:game_data)}/covenant/soulbind/index", **default_options.merge(options)
35
+ end
36
+
37
+ ##
38
+ # Fetch a soulbind by its id
39
+ #
40
+ # @param id Soulbind id
41
+ #
42
+ # @!macro request_options
43
+ #
44
+ # @!macro response
45
+ def soulbind(id, **options)
46
+ api_request "#{base_url(:game_data)}/covenant/soulbind/#{id}", **default_options.merge(options)
47
+ end
48
+
49
+ ##
50
+ # Fetch all conduits
51
+ #
52
+ # @!macro request_options
53
+ #
54
+ # @!macro response
55
+ def conduits(**options)
56
+ api_request "#{base_url(:game_data)}/covenant/conduit/index", **default_options.merge(options)
57
+ end
58
+
59
+ ##
60
+ # Fetch a conduit by its id
61
+ #
62
+ # @param id Conduit id
63
+ #
64
+ # @!macro request_options
65
+ #
66
+ # @!macro response
67
+ def conduit(id, **options)
68
+ api_request "#{base_url(:game_data)}/covenant/conduit/#{id}", **default_options.merge(options)
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module Wow
5
+ ##
6
+ # This class allows access to World of Warcraft creatures
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.creature
12
+ class Creature < Wow::GenericDataEndpoint
13
+ include BlizzardApi::Wow::Searchable
14
+
15
+ setup 'creature', :static, CACHE_TRIMESTER
16
+
17
+ def index
18
+ raise BlizzardApi::ApiException, 'Creatures endpoint does not have an index method'
19
+ end
20
+
21
+ ##
22
+ # Fetch all creature families
23
+ #
24
+ # @!macro request_options
25
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
26
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
27
+ #
28
+ # @!macro response
29
+ def families(**options)
30
+ api_request "#{endpoint_uri('family')}/index", **default_options.merge(options)
31
+ end
32
+
33
+ ##
34
+ # Fetch all possible data for one of the items listed by the {#families} using its *id*
35
+ #
36
+ # @param id [Integer] Creature family id
37
+ #
38
+ # @!macro request_options
39
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
40
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
41
+ #
42
+ # @!macro response
43
+ def family(id, **options)
44
+ api_request "#{endpoint_uri('family')}/#{id}", **default_options.merge(options)
45
+ end
46
+
47
+ ##
48
+ # Fetch media for one of the items listed by the {#families} using its *id*
49
+ #
50
+ # @param id [Integer] Creature family id
51
+ #
52
+ # @!macro request_options
53
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
54
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
55
+ #
56
+ # @!macro response
57
+ def family_media(id, **options)
58
+ api_request "#{base_url(:media)}/creature-family/#{id}", **default_options.merge(options)
59
+ end
60
+
61
+ ##
62
+ # Fetch all creature types
63
+ #
64
+ # @!macro request_options
65
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
66
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
67
+ #
68
+ # @!macro response
69
+ def types(**options)
70
+ api_request "#{endpoint_uri('type')}/index", **default_options.merge(options)
71
+ end
72
+
73
+ ##
74
+ # Fetch all possible data for one of the items listed by the {#types} using its *id*
75
+ #
76
+ # @param id [Integer] Creature type id
77
+ #
78
+ # @!macro request_options
79
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
80
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
81
+ #
82
+ # @!macro response
83
+ def type(id, **options)
84
+ api_request "#{endpoint_uri('type')}/#{id}", **default_options.merge(options)
85
+ end
86
+
87
+ ##
88
+ # Fetch media for one of the items listed by the {#types} using its *id*
89
+ #
90
+ # @param id [Integer] Creature type id
91
+ #
92
+ # @!macro request_options
93
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
94
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
95
+ #
96
+ # @!macro response
97
+ def display_media(id, **options)
98
+ api_request "#{base_url(:media)}/creature-display/#{id}", **default_options.merge(options)
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module Wow
5
+ ##
6
+ # Generic endpoint to support most data requests with minor configurations
7
+ class GenericDataEndpoint < Wow::Request
8
+ class << self
9
+ attr_accessor :endpoint, :namespace, :ttl
10
+
11
+ def setup(endpoint, namespace, ttl)
12
+ self.endpoint = endpoint
13
+ self.namespace = namespace
14
+ self.ttl = ttl
15
+ end
16
+ end
17
+
18
+ ##
19
+ # Fetch a list of all resources available for this endpoint
20
+ #
21
+ # @!macro request_options
22
+ # @!macro response
23
+ def index(**options)
24
+ api_request "#{endpoint_uri}/index", **default_options.merge(options)
25
+ end
26
+
27
+ ##
28
+ # Fetch all possible data for one of the items listed by the {#index} using its *id*
29
+ #
30
+ # @param id [Integer] One of the IDs returned by the {#index}
31
+ # @!macro request_options
32
+ #
33
+ # @!macro response
34
+ def get(id, **options)
35
+ api_request "#{endpoint_uri}/#{id}", **default_options.merge(options)
36
+ end
37
+
38
+ protected
39
+
40
+ def endpoint_uri(variant = nil, scope = :game_data)
41
+ endpoint = variant ? "#{self.class.endpoint}-#{variant}" : self.class.endpoint
42
+ "#{base_url(scope)}/#{endpoint}"
43
+ end
44
+
45
+ def default_options
46
+ { namespace: self.class.namespace, ttl: self.class.ttl }
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module Wow
5
+ ##
6
+ # This class allows access to World of Warcraft guild crest 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.guild_crest
12
+ class GuildCrest < Wow::GenericDataEndpoint
13
+ setup 'guild-crest', :static, CACHE_TRIMESTER
14
+
15
+ def get
16
+ raise BlizzardApi::ApiException, 'This endpoint does not have a get method'
17
+ end
18
+
19
+ ##
20
+ # Return guild border assets by its id
21
+ #
22
+ # @param id [Integer] Border id
23
+ #
24
+ # @!macro request_options
25
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
26
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
27
+ #
28
+ # @!macro response
29
+ def border_media(id, **options)
30
+ api_request "#{base_url(:media)}/#{self.class.endpoint}/border/#{id}", **default_options.merge(options)
31
+ end
32
+
33
+ ##
34
+ # Return guild embelm assets by its id
35
+ #
36
+ # @param id [Integer] Emblem id
37
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
38
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
39
+ #
40
+ # @!macro request_options
41
+ #
42
+ # @!macro response
43
+ def emblem_media(id, **options)
44
+ api_request "#{base_url(:media)}/#{self.class.endpoint}/emblem/#{id}", **default_options.merge(options)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -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
@@ -0,0 +1,102 @@
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/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.item
12
+ class Item < Wow::GenericDataEndpoint
13
+ include BlizzardApi::Wow::Searchable
14
+
15
+ setup 'item', :static, CACHE_TRIMESTER
16
+
17
+ ##
18
+ # This method overrides the inherited default behavior to prevent high server load and fetch time
19
+ #
20
+ # @!macro response
21
+ def index
22
+ raise BlizzardApi::ApiException, 'This endpoint does not have a index method'
23
+ end
24
+
25
+ ##
26
+ # Return a list of item classes
27
+ #
28
+ # @!macro request_options
29
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
30
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
31
+ #
32
+ # @!macro response
33
+ def classes(**options)
34
+ api_request "#{endpoint_uri('class')}/index", **default_options.merge(options)
35
+ end
36
+ alias item_classes classes
37
+
38
+ ##
39
+ # Return data about an item class
40
+ #
41
+ # @param id [Integer] Item class id
42
+ # @!macro request_options
43
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
44
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
45
+ #
46
+ # @!macro response
47
+ def item_class(id, **options)
48
+ api_request "#{endpoint_uri('class')}/#{id}", **default_options.merge(options)
49
+ end
50
+
51
+ ##
52
+ # Return all subclasses of a given class
53
+ #
54
+ # @param id [Integer] Item class id
55
+ # @param subclass_id [Integer] Item subclass id
56
+ # @!macro request_options
57
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
58
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
59
+ #
60
+ # @!macro response
61
+ def subclass(id, subclass_id, **options)
62
+ api_request "#{endpoint_uri('class')}/#{id}/item-subclass/#{subclass_id}", **default_options.merge(options)
63
+ end
64
+ alias item_subclass subclass
65
+
66
+ ##
67
+ # Fetch media for an item using its *id*
68
+ #
69
+ # @param id [Integer] Item id
70
+ #
71
+ # @!macro request_options
72
+ # @option options [Boolean] :classic If set to true, this method will call the classic version
73
+ # @option options [Boolean] :classic1x If set to true, this method will call the classic era version
74
+ #
75
+ # @!macro response
76
+ def media(id, **options)
77
+ api_request "#{base_url(:media)}/item/#{id}", **default_options.merge(options)
78
+ end
79
+
80
+ ##
81
+ # Return a list of item sets
82
+ #
83
+ # @!macro request_options
84
+ #
85
+ # @!macro response
86
+ def sets(**options)
87
+ api_request "#{endpoint_uri('set')}/index", **default_options.merge(options)
88
+ end
89
+
90
+ ##
91
+ # Return data about an item set
92
+ #
93
+ # @param id [Integer] Item set id
94
+ # @!macro request_options
95
+ #
96
+ # @!macro response
97
+ def set(id, **options)
98
+ api_request "#{endpoint_uri('set')}/#{id}", **default_options.merge(options)
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module Wow
5
+ ##
6
+ # This class allows access to World of Warcraft journal data
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.journal
12
+ class Journal < Wow::GenericDataEndpoint
13
+ setup 'journal', :static, CACHE_TRIMESTER
14
+
15
+ ##
16
+ # This method overrides the inherited default behavior to prevent high server load and fetch time
17
+ #
18
+ # @!macro response
19
+ def index
20
+ raise BlizzardApi::ApiException, 'This endpoint does not have a index method'
21
+ end
22
+
23
+ ##
24
+ # This method overrides the inherited default behavior to prevent high server load and fetch time
25
+ #
26
+ # @!macro response
27
+ def get(_id)
28
+ raise BlizzardApi::ApiException, 'This endpoint does not have a get method'
29
+ end
30
+
31
+ ##
32
+ # Return a list of expansion journal entries
33
+ #
34
+ # @!macro request_options
35
+ #
36
+ # @!macro response
37
+ def expansions(**options)
38
+ api_request "#{endpoint_uri('expansion')}/index", **default_options.merge(options)
39
+ end
40
+
41
+ ##
42
+ # Return data about an expansion journal entry
43
+ #
44
+ # @param id [Integer] Journal entry id
45
+ # @!macro request_options
46
+ #
47
+ # @!macro response
48
+ def expansion(id, **options)
49
+ api_request "#{endpoint_uri('expansion')}/#{id}", **default_options.merge(options)
50
+ end
51
+
52
+ ##
53
+ # Return a list of instance journal entries
54
+ #
55
+ # @!macro request_options
56
+ #
57
+ # @!macro response
58
+ def instances(**options)
59
+ api_request "#{endpoint_uri('instance')}/index", **default_options.merge(options)
60
+ end
61
+
62
+ ##
63
+ # Return data about an instance journal entry
64
+ #
65
+ # @param id [Integer] Journal entry id
66
+ # @!macro request_options
67
+ #
68
+ # @!macro response
69
+ def instance(id, **options)
70
+ api_request "#{endpoint_uri('instance')}/#{id}", **default_options.merge(options)
71
+ end
72
+
73
+ ##
74
+ # Return a list of encounter journal entries
75
+ #
76
+ # @!macro request_options
77
+ #
78
+ # @!macro response
79
+ def encounters(**options)
80
+ api_request "#{endpoint_uri('encounter')}/index", **default_options.merge(options)
81
+ end
82
+
83
+ ##
84
+ # Return data about an encounter journal entry
85
+ #
86
+ # @param id [Integer] Journal entry id
87
+ # @!macro request_options
88
+ #
89
+ # @!macro response
90
+ def encounter(id, **options)
91
+ api_request "#{endpoint_uri('encounter')}/#{id}", **default_options.merge(options)
92
+ end
93
+
94
+ ##
95
+ # Fetch data base on search criteria
96
+ #
97
+ # @param page [Integer] Page o return
98
+ # @param page_size [Integer] Amount of items per page
99
+ #
100
+ # @!macro request_options
101
+ # @!macro response
102
+ def encounter_search(page = 1, page_size = 100, **options)
103
+ search_options = SearchComposer.new(page, page_size)
104
+ yield search_options if block_given?
105
+
106
+ api_request "#{endpoint_uri('encounter', :search)}?#{search_options.to_search_query}", **default_options.merge(options)
107
+ end
108
+ end
109
+ end
110
+ end
@@ -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 mounts
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.mount
12
+ class Media < Wow::GenericDataEndpoint
13
+ include BlizzardApi::Wow::Searchable
14
+
15
+ setup 'media', :static, CACHE_TRIMESTER
16
+
17
+ def index(_options = nil)
18
+ raise BlizzardApi::ApiException, 'This endpoint does not have a index method'
19
+ end
20
+
21
+ def get(_options = nil)
22
+ raise BlizzardApi::ApiException, 'This endpoint does not have a get method'
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,60 @@
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.modified_crafting
12
+ class ModifiedCrafting < Wow::GenericDataEndpoint
13
+ setup 'modified-crafting', :static, CACHE_TRIMESTER
14
+
15
+ def get(_id, **_options)
16
+ raise BlizzardApi::ApiException, 'This endpoint does not have a get method'
17
+ end
18
+
19
+ ##
20
+ # Fetch modified crafting category index
21
+ #
22
+ # @!macro request_options
23
+ def categories(**options)
24
+ api_request "#{base_url(:game_data)}/modified-crafting/category/index", **default_options.merge(options)
25
+ end
26
+
27
+ ##
28
+ # Fetch a modified crafting category
29
+ #
30
+ # @param id [Integer] Modified crafting category id
31
+ #
32
+ # @!macro request_options
33
+ #
34
+ # @!macro response
35
+ def category(id, **options)
36
+ api_request "#{base_url(:game_data)}/modified-crafting/category/#{id}", **default_options.merge(options)
37
+ end
38
+
39
+ ##
40
+ # Fetch modified crafting slot type index
41
+ #
42
+ # @!macro request_options
43
+ def slot_types(**options)
44
+ api_request "#{base_url(:game_data)}/modified-crafting/reagent-slot-type/index", **default_options.merge(options)
45
+ end
46
+
47
+ ##
48
+ # Fetch a modified crafting slot type
49
+ #
50
+ # @param id [Integer] Modified crafting slot type id
51
+ #
52
+ # @!macro request_options
53
+ #
54
+ # @!macro response
55
+ def slot_type(id, **options)
56
+ api_request "#{base_url(:game_data)}/modified-crafting/reagent-slot-type/#{id}", **default_options.merge(options)
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlizzardApi
4
+ module Wow
5
+ ##
6
+ # This class allows access to World of Warcraft mounts
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.mount
12
+ class Mount < Wow::GenericDataEndpoint
13
+ include BlizzardApi::Wow::Searchable
14
+
15
+ setup 'mount', :static, CACHE_TRIMESTER
16
+ end
17
+ end
18
+ end