Class: BlizzardApi::Hearthstone::Card
- Inherits:
-
GenericDataEndpoint
- Object
- Request
- Request
- GenericDataEndpoint
- BlizzardApi::Hearthstone::Card
- Defined in:
- lib/blizzard_api_rb/hearthstone/game_data/card.rb
Overview
This class allows access to Hearthstone card data
You can get an instance of this class using the default region as follows:
api_instance = BlizzardApi::Hearthstone.card
Constant Summary collapse
- VALID_SEARCH_OPTIONS =
Valid options for card search
%i[ set class manaCost attack health collectible rarity type minionType keyword textFilter gameMode page pageSize sort order ].freeze
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(id_or_slug, game_mode = 'constructed', **options) ⇒ Hash
Returns the card with an ID or slug that matches the one you specify.
-
#search(search_options = {}, **options) ⇒ Hash
Fetch all possible data for one of the items listed by the #index using its id.
Methods inherited from GenericDataEndpoint
Methods inherited from Request
Methods inherited from Request
Constructor Details
This class inherits a constructor from BlizzardApi::Hearthstone::GenericDataEndpoint
Instance Method Details
#get(id_or_slug, game_mode = 'constructed', **options) ⇒ Hash
Returns the card with an ID or slug that matches the one you specify. For more information, see the Card Search Guide.
in the configuration module
93 94 95 |
# File 'lib/blizzard_api_rb/hearthstone/game_data/card.rb', line 93 def get(id_or_slug, game_mode = 'constructed', **) super id_or_slug, **{ gameMode: game_mode }.merge() end |
#search(search_options = {}, **options) ⇒ Hash
Fetch all possible data for one of the items listed by the #index using its id
in the configuration module
75 76 77 78 79 |
# File 'lib/blizzard_api_rb/hearthstone/game_data/card.rb', line 75 def search( = {}, **) if .include? :validate_fields api_request "#{base_url(:community)}/cards", **.merge().merge() end |