Class: BlizzardApi::Wow::Item
- Inherits:
-
GenericDataEndpoint
- Object
- Request
- Request
- GenericDataEndpoint
- BlizzardApi::Wow::Item
- Includes:
- Searchable
- Defined in:
- lib/blizzard_api/wow/game_data/item.rb
Overview
This class allows access to World of Warcraft item data
You can get an instance of this class using the default region as follows:
api_instance = BlizzardApi::Wow.item
Constant Summary
Constants inherited from Request
Request::CACHE_DAY, Request::CACHE_HOUR, Request::CACHE_TRIMESTER
Constants included from ApiStandards
Instance Attribute Summary
Attributes inherited from Request
Instance Method Summary collapse
-
#classes(**options) ⇒ Hash
(also: #item_classes)
Return a list of item classes.
-
#index ⇒ Hash
This method overrides the inherited default behavior to prevent high server load and fetch time.
-
#item_class(id, **options) ⇒ Hash
Return data about an item class.
-
#media(id, **options) ⇒ Hash
Fetch media for an item using its id.
-
#set(id, **options) ⇒ Hash
Return data about an item set.
-
#sets(**options) ⇒ Hash
Return a list of item sets.
-
#subclass(id, subclass_id, **options) ⇒ Hash
(also: #item_subclass)
Return all subclasses of a given class.
Methods included from Searchable
Methods inherited from GenericDataEndpoint
Methods inherited from Request
Methods inherited from Request
Constructor Details
This class inherits a constructor from BlizzardApi::Wow::Request
Instance Method Details
#classes(**options) ⇒ Hash Also known as: item_classes
Return a list of item classes
in the configuration module
33 34 35 |
# File 'lib/blizzard_api/wow/game_data/item.rb', line 33 def classes(**) api_request "#{endpoint_uri('class')}/index", **.merge() end |
#index ⇒ Hash
This method overrides the inherited default behavior to prevent high server load and fetch time
in the configuration module
21 22 23 |
# File 'lib/blizzard_api/wow/game_data/item.rb', line 21 def index raise BlizzardApi::ApiException, 'This endpoint does not have an index method' end |
#item_class(id, **options) ⇒ Hash
Return data about an item class
in the configuration module
47 48 49 |
# File 'lib/blizzard_api/wow/game_data/item.rb', line 47 def item_class(id, **) api_request "#{endpoint_uri('class')}/#{id}", **.merge() end |
#media(id, **options) ⇒ Hash
Fetch media for an item using its id
in the configuration module
76 77 78 |
# File 'lib/blizzard_api/wow/game_data/item.rb', line 76 def media(id, **) api_request "#{base_url(:media)}/item/#{id}", **.merge() end |
#set(id, **options) ⇒ Hash
Return data about an item set
in the configuration module
97 98 99 |
# File 'lib/blizzard_api/wow/game_data/item.rb', line 97 def set(id, **) api_request "#{endpoint_uri('set')}/#{id}", **.merge() end |
#sets(**options) ⇒ Hash
Return a list of item sets
in the configuration module
86 87 88 |
# File 'lib/blizzard_api/wow/game_data/item.rb', line 86 def sets(**) api_request "#{endpoint_uri('set')}/index", **.merge() end |
#subclass(id, subclass_id, **options) ⇒ Hash Also known as: item_subclass
Return all subclasses of a given class
in the configuration module
61 62 63 |
# File 'lib/blizzard_api/wow/game_data/item.rb', line 61 def subclass(id, subclass_id, **) api_request "#{endpoint_uri('class')}/#{id}/item-subclass/#{subclass_id}", **.merge() end |