Class: BlizzardApi::Wow::GenericDataEndpoint
- Defined in:
- lib/blizzard_api/wow/game_data/generic_data_endpoint.rb
Overview
Generic endpoint to support most data requests with minor configurations
Direct Known Subclasses
Achievement, AzeriteEssence, ConnectedRealm, Covenant, Creature, GuildCrest, Heirloom, Item, ItemAppearance, Journal, Media, ModifiedCrafting, Mount, MythicKeystone, MythicKeystoneAffix, Pet, PlayableClass, PlayableRace, PlayableSpecialization, PowerType, Profession, PvpRegion, PvpSeason, PvpTier, Quest, Realm, Region, Reputation, Spell, Talent, TechTalent, Title, Toy, WowToken
Constant Summary
Constants inherited from Request
Request::CACHE_DAY, Request::CACHE_HOUR, Request::CACHE_TRIMESTER
Constants included from ApiStandards
Class Attribute Summary collapse
-
.endpoint ⇒ Object
Returns the value of attribute endpoint.
-
.namespace ⇒ Object
Returns the value of attribute namespace.
-
.ttl ⇒ Object
Returns the value of attribute ttl.
Attributes inherited from Request
Class Method Summary collapse
Instance Method Summary collapse
-
#get(id, **options) ⇒ Hash
Fetch all possible data for one of the items listed by the #index using its id.
-
#index(**options) ⇒ Hash
Fetch a list of all resources available for this endpoint.
Methods inherited from Request
Methods inherited from Request
Constructor Details
This class inherits a constructor from BlizzardApi::Wow::Request
Class Attribute Details
.endpoint ⇒ Object
Returns the value of attribute endpoint.
9 10 11 |
# File 'lib/blizzard_api/wow/game_data/generic_data_endpoint.rb', line 9 def endpoint @endpoint end |
.namespace ⇒ Object
Returns the value of attribute namespace.
9 10 11 |
# File 'lib/blizzard_api/wow/game_data/generic_data_endpoint.rb', line 9 def namespace @namespace end |
.ttl ⇒ Object
Returns the value of attribute ttl.
9 10 11 |
# File 'lib/blizzard_api/wow/game_data/generic_data_endpoint.rb', line 9 def ttl @ttl end |
Class Method Details
.setup(endpoint, namespace, ttl) ⇒ Object
11 12 13 14 15 |
# File 'lib/blizzard_api/wow/game_data/generic_data_endpoint.rb', line 11 def setup(endpoint, namespace, ttl) self.endpoint = endpoint self.namespace = namespace self.ttl = ttl end |
Instance Method Details
#get(id, **options) ⇒ Hash
Fetch all possible data for one of the items listed by the #index using its id
in the configuration module
34 35 36 |
# File 'lib/blizzard_api/wow/game_data/generic_data_endpoint.rb', line 34 def get(id, **) api_request "#{endpoint_uri}/#{id}", **.merge() end |
#index(**options) ⇒ Hash
Fetch a list of all resources available for this endpoint
in the configuration module
23 24 25 |
# File 'lib/blizzard_api/wow/game_data/generic_data_endpoint.rb', line 23 def index(**) api_request "#{endpoint_uri}/index", **.merge() end |