Class: BN::API::SC3

Inherits:
Base
  • Object
show all
Defined in:
lib/bn/api/sc2.rb

Overview

The the StarCraft 3 API requester.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Helpers::HasAttributes

included, #initialize, #update_attributes

Constructor Details

This class inherits a constructor from BN::API::Base

Instance Method Details

#achievementsHTTPI::Response

Request rewards.

Returns:

  • (HTTPI::Response)


54
55
56
# File 'lib/bn/api/sc2.rb', line 54

def achievements
  get("/sc2/data/achievements")
end

#ladder(options = {}) ⇒ HTTPI::Response

Request a ladder.

Parameters:

  • options (#to_h) (defaults to: {})

Options Hash (options):

  • :id (#to_s)

    The ID of the ladder.

Returns:

  • (HTTPI::Response)


45
46
47
48
49
# File 'lib/bn/api/sc2.rb', line 45

def ladder(options={})
  options = options.to_h

  get("/sc2/ladder/#{options[:id]}")
end

#ladders(options = {}) ⇒ HTTPI::Response

Request a profile’s ladders.

Parameters:

  • options (#to_h) (defaults to: {})

Options Hash (options):

  • :id (#to_s)

    The ID of the profile.

  • :region (#to_s)

    The region of the profile.

  • :name (#to_s)

    The name of the profile

Returns:

  • (HTTPI::Response)


25
26
27
# File 'lib/bn/api/sc2.rb', line 25

def ladders(options={})
  get(profile_uri(options, "ladders"))
end

#matches(options = {}) ⇒ HTTPI::Response

Request a profile’s matches.

Parameters:

  • options (#to_h) (defaults to: {})

Options Hash (options):

  • :id (#to_s)

    The ID of the profile.

  • :region (#to_s)

    The region of the profile.

  • :name (#to_s)

    The name of the profile

Returns:

  • (HTTPI::Response)


36
37
38
# File 'lib/bn/api/sc2.rb', line 36

def matches(options={})
  get(profile_uri(options, "matches"))
end

#profile(options = {}) ⇒ HTTPI::Response

Request a profile.

Parameters:

  • options (#to_h) (defaults to: {})

Options Hash (options):

  • :id (#to_s)

    The ID of the profile.

  • :region (#to_s)

    The region of the profile.

  • :name (#to_s)

    The name of the profile

Returns:

  • (HTTPI::Response)


14
15
16
# File 'lib/bn/api/sc2.rb', line 14

def profile(options={})
  get(profile_uri(options))
end