Class: BlizzardApi::Wow::Creature

Inherits:
GenericDataEndpoint show all
Includes:
Searchable
Defined in:
lib/blizzard_api/wow/game_data/creature.rb

Overview

This class allows access to World of Warcraft creatures

You can get an instance of this class using the default region as follows:

api_instance = BlizzardApi::Wow.creature

Constant Summary

Constants inherited from Request

Request::CACHE_DAY, Request::CACHE_HOUR, Request::CACHE_TRIMESTER

Constants included from ApiStandards

ApiStandards::BASE_URLS

Instance Attribute Summary

Attributes inherited from Request

#mode, #region

Instance Method Summary collapse

Methods included from Searchable

#search

Methods inherited from GenericDataEndpoint

#get, setup

Methods inherited from Request

#initialize

Methods inherited from Request

#initialize

Constructor Details

This class inherits a constructor from BlizzardApi::Wow::Request

Instance Method Details

#display_media(id, **options) ⇒ Hash

Fetch media for one of the items listed by the #types using its id

in the configuration module

Parameters:

  • id (Integer)

    Creature type id

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

  • :classic (Boolean)

    If set to true, this method will call the classic version

  • :classic1x (Boolean)

    If set to true, this method will call the classic era version

Returns:

  • (Hash)

    API Response. The actual type of the returned object depends on the format option



97
98
99
# File 'lib/blizzard_api/wow/game_data/creature.rb', line 97

def display_media(id, **options)
  api_request "#{base_url(:media)}/creature-display/#{id}", **default_options.merge(options)
end

#families(**options) ⇒ Hash

Fetch all creature families

in the configuration module

Parameters:

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

  • :classic (Boolean)

    If set to true, this method will call the classic version

  • :classic1x (Boolean)

    If set to true, this method will call the classic era version

Returns:

  • (Hash)

    API Response. The actual type of the returned object depends on the format option



29
30
31
# File 'lib/blizzard_api/wow/game_data/creature.rb', line 29

def families(**options)
  api_request "#{endpoint_uri('family')}/index", **default_options.merge(options)
end

#family(id, **options) ⇒ Hash

Fetch all possible data for one of the items listed by the #families using its id

in the configuration module

Parameters:

  • id (Integer)

    Creature family id

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

  • :classic (Boolean)

    If set to true, this method will call the classic version

  • :classic1x (Boolean)

    If set to true, this method will call the classic era version

Returns:

  • (Hash)

    API Response. The actual type of the returned object depends on the format option



43
44
45
# File 'lib/blizzard_api/wow/game_data/creature.rb', line 43

def family(id, **options)
  api_request "#{endpoint_uri('family')}/#{id}", **default_options.merge(options)
end

#family_media(id, **options) ⇒ Hash

Fetch media for one of the items listed by the #families using its id

in the configuration module

Parameters:

  • id (Integer)

    Creature family id

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

  • :classic (Boolean)

    If set to true, this method will call the classic version

  • :classic1x (Boolean)

    If set to true, this method will call the classic era version

Returns:

  • (Hash)

    API Response. The actual type of the returned object depends on the format option



57
58
59
# File 'lib/blizzard_api/wow/game_data/creature.rb', line 57

def family_media(id, **options)
  api_request "#{base_url(:media)}/creature-family/#{id}", **default_options.merge(options)
end

#indexObject



17
18
19
# File 'lib/blizzard_api/wow/game_data/creature.rb', line 17

def index
  raise BlizzardApi::ApiException, 'Creatures endpoint does not have an index method'
end

#type(id, **options) ⇒ Hash

Fetch all possible data for one of the items listed by the #types using its id

in the configuration module

Parameters:

  • id (Integer)

    Creature type id

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

  • :classic (Boolean)

    If set to true, this method will call the classic version

  • :classic1x (Boolean)

    If set to true, this method will call the classic era version

Returns:

  • (Hash)

    API Response. The actual type of the returned object depends on the format option



83
84
85
# File 'lib/blizzard_api/wow/game_data/creature.rb', line 83

def type(id, **options)
  api_request "#{endpoint_uri('type')}/#{id}", **default_options.merge(options)
end

#types(**options) ⇒ Hash

Fetch all creature types

in the configuration module

Parameters:

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

  • :classic (Boolean)

    If set to true, this method will call the classic version

  • :classic1x (Boolean)

    If set to true, this method will call the classic era version

Returns:

  • (Hash)

    API Response. The actual type of the returned object depends on the format option



69
70
71
# File 'lib/blizzard_api/wow/game_data/creature.rb', line 69

def types(**options)
  api_request "#{endpoint_uri('type')}/index", **default_options.merge(options)
end