Class: BlizzardApi::Wow::Auction

Inherits:
Request show all
Defined in:
lib/blizzard_api/wow/game_data/auction.rb

Overview

This class allows access to World of Warcraft auctions

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

api_instance = BlizzardApi::Wow.auction

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 inherited from Request

#initialize

Methods inherited from Request

#initialize

Constructor Details

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

Instance Method Details

#commodities(**options) ⇒ Object



43
44
45
46
47
# File 'lib/blizzard_api/wow/game_data/auction.rb', line 43

def commodities(**options)
  opts = { ttl: CACHE_HOUR, namespace: :dynamic }.merge(options)

  api_request "#{base_url(:game_data)}/auctions/commodities", **opts
end

#get(connected_realm_id, auction_house_id = nil, **options) ⇒ Hash

Return all active auctions for the specified connected realm

in the configuration module

Parameters:

  • connected_realm_id (Integer)

    A valid connected realm 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.

  • :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



33
34
35
36
37
38
39
40
41
# File 'lib/blizzard_api/wow/game_data/auction.rb', line 33

def get(connected_realm_id, auction_house_id = nil, **options)
  opts = { ttl: CACHE_HOUR, namespace: :dynamic }.merge(options)

  unless auction_house_id.nil?
    return api_request "#{base_url(:game_data)}/connected-realm/#{connected_realm_id}/auctions/#{auction_house_id}", **opts
  end

  api_request "#{base_url(:game_data)}/connected-realm/#{connected_realm_id}/auctions", **opts
end

#index(connected_realm_id, **options) ⇒ Hash

Return all auction houses for the specified connected realm. Classic only.

in the configuration module

Parameters:

  • connected_realm_id (Integer)

    A valid connected realm 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.

Returns:

  • (Hash)

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



20
21
22
23
# File 'lib/blizzard_api/wow/game_data/auction.rb', line 20

def index(connected_realm_id, **options)
  opts = { ttl: CACHE_HOUR, namespace: :dynamic }.merge(options)
  api_request "#{base_url(:game_data)}/connected-realm/#{connected_realm_id}/auctions/index", **opts
end