Class: BlizzardApi::Starcraft::Ladder

Inherits:
Request show all
Defined in:
lib/blizzard_api/starcraft/community/ladder.rb

Overview

This class allows access to Starcraft II ladder data

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

api_instance = BlizzardApi::Starcraft.ladder

Constant Summary

Constants inherited from Request

Request::SC_REGION

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::Starcraft::Request

Instance Method Details

#grandmaster(region_id, **options) ⇒ Object

Note:

This gem do not support nor will support China endpoints

Grandmaster endpoint

Parameters:

  • region_id (Symbol)

    One of the valid Starcraft II regions :US, :EU, :KO, and :TW

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



18
19
20
21
# File 'lib/blizzard_api/starcraft/community/ladder.rb', line 18

def grandmaster(region_id, **options)
  reg = resolve_region(region_id)
  api_request "#{base_url(:community)}/ladder/grandmaster/#{reg}", **{ ttl: CACHE_DAY }.merge(options)
end

#season(region_id, **options) ⇒ Object

Note:

This gem do not support nor will support China endpoints

Season endpoint

Parameters:

  • region_id (Symbol)

    One of the valid Starcraft II regions :US, :EU, :KO, and :TW

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



28
29
30
31
# File 'lib/blizzard_api/starcraft/community/ladder.rb', line 28

def season(region_id, **options)
  reg = resolve_region(region_id)
  api_request "#{base_url(:community)}/ladder/season/#{reg}", **{ ttl: CACHE_DAY }.merge(options)
end