Class: BlizzardApi::Wow::PvpRegion

Inherits:
GenericDataEndpoint show all
Defined in:
lib/blizzard_api/wow/game_data/pvp_region.rb

Overview

This class allows access to World of Warcraft PvP seasons

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

api_instance = BlizzardApi::Wow.pvp_season

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 GenericDataEndpoint

#get, #index, 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

#leaderboard(region_id, season_id, brackets, **options) ⇒ Hash

Returns the leaderboard for a given season and bracket

in the configuration module

Parameters:

  • region_id (Integer)

    Region ID

  • season_id (Integer)

    Season ID

  • brackets (String)

    Brackets

  • 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



67
68
69
# File 'lib/blizzard_api/wow/game_data/pvp_region.rb', line 67

def leaderboard(region_id, season_id, brackets, **options)
  api_request "#{endpoint_uri}/#{region_id}/pvp-season/#{season_id}/pvp-leaderboard/#{brackets}", **default_options.merge(options)
end

#leaderboards(region_id, season_id, **options) ⇒ Hash

Returns a index of pvp leaderboard for a season

in the configuration module

Parameters:

  • region_id (Integer)

    Region ID

  • season_id (Integer)

    Season 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



52
53
54
# File 'lib/blizzard_api/wow/game_data/pvp_region.rb', line 52

def leaderboards(region_id, season_id, **options)
  api_request "#{endpoint_uri}/#{region_id}/pvp-season/#{season_id}/pvp-leaderboard/index", **default_options.merge(options)
end

#rewards(region_id, season_id, **options) ⇒ Hash

Returns a list of pvp rewards for a season

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.

Returns:

  • (Hash)

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



77
78
79
# File 'lib/blizzard_api/wow/game_data/pvp_region.rb', line 77

def rewards(region_id, season_id, **options)
  api_request "#{endpoint_uri}/#{region_id}/pvp-season/#{season_id}/pvp-reward/index", **default_options.merge(options)
end

#season(region_id, season_id, **options) ⇒ Hash

Returns a index of pvp seasons within the region

in the configuration module

Parameters:

  • region_id (Integer)

    Region ID

  • season_id (Integer)

    Season 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



38
39
40
# File 'lib/blizzard_api/wow/game_data/pvp_region.rb', line 38

def season(region_id, season_id, **options)
  api_request "#{endpoint_uri}/#{region_id}/pvp-season/#{season_id}", **default_options.merge(options)
end

#seasons(region_id, **options) ⇒ Hash

Returns a index of pvp seasons within the region

in the configuration module

Parameters:

  • region_id (Integer)

    Region 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



24
25
26
# File 'lib/blizzard_api/wow/game_data/pvp_region.rb', line 24

def seasons(region_id, **options)
  api_request "#{endpoint_uri}/#{region_id}/pvp-season/index", **default_options.merge(options)
end