Class: BlizzardApi::Diablo::Artisan
- Defined in:
- lib/blizzard_api/diablo/community/artisan.rb
Overview
This class allows access to Diablo III artisan data
You can get an instance of this class using the default region as follows:
api_instance = BlizzardApi::Diablo.artisan
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
-
#get(artisan_slug, **options) ⇒ Hash
Return data about an artisan by its slug.
-
#recipe(artisan_slug, recipe_slug, **options) ⇒ Hash
Return data about an artisan recipe.
Methods inherited from Request
Methods inherited from Request
Constructor Details
This class inherits a constructor from BlizzardApi::Diablo::Request
Instance Method Details
#get(artisan_slug, **options) ⇒ Hash
Return data about an artisan by its slug
in the configuration module
20 21 22 |
# File 'lib/blizzard_api/diablo/community/artisan.rb', line 20 def get(artisan_slug, **) api_request "#{base_url(:community)}/data/artisan/#{artisan_slug}", **{ ttl: CACHE_TRIMESTER }.merge() end |
#recipe(artisan_slug, recipe_slug, **options) ⇒ Hash
Return data about an artisan recipe
in the configuration module
32 33 34 35 |
# File 'lib/blizzard_api/diablo/community/artisan.rb', line 32 def recipe(artisan_slug, recipe_slug, **) opts = { ttl: CACHE_TRIMESTER }.merge() api_request "#{base_url(:community)}/data/artisan/#{artisan_slug}/recipe/#{recipe_slug}", **opts end |