Module: BnetApi::SC2

Extended by:
SC2
Included in:
SC2
Defined in:
lib/bnet_api/sc2.rb

Overview

All API methods relating to Starcraft II are contained in this module.

Instance Method Summary collapse

Instance Method Details

#achievements_dataHash

Retrieves all achievements data.

Returns:

  • (Hash)

    A hash containing the achievements data.



48
49
50
# File 'lib/bnet_api/sc2.rb', line 48

def achievements_data
  BnetApi.make_request('/sc2/data/achievements')
end

#ladder(id) ⇒ Hash

Retrieves the ladder data for the ladder with the specified ID.

Parameters:

  • id (String)

    The ID of the ladder.

Returns:

  • (Hash)

    A hash containing the ladder data.



42
43
44
# File 'lib/bnet_api/sc2.rb', line 42

def ladder(id)
  BnetApi.make_request("/sc2/ladder/#{id}")
end

#match_history(id, region, name) ⇒ Hash

Retrieves the match history for the specified profile.

Parameters:

  • id (Integer)

    The user's profile ID.

  • region (Integer)

    The region the user is in.

  • name (String)

    The name of the user's profile.

Returns:

  • (Hash)

    A hash containing the profile's match history data.



34
35
36
# File 'lib/bnet_api/sc2.rb', line 34

def match_history(id, region, name)
  BnetApi.make_request("/sc2/profile/#{id}/#{region}/#{name}/matches")
end

#profile(id, region, name) ⇒ Hash

Retrieves the profile for specified user.

Parameters:

  • id (Integer)

    The user's profile ID.

  • region (Integer)

    The region the user is in.

  • name (String)

    The name of the user's profile.

Returns:

  • (Hash)

    A hash containing the profile data.



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

def profile(id, region, name)
  BnetApi.make_request("/sc2/profile/#{id}/#{region}/#{name}/")
end

#profile_ladders(id, region, name) ⇒ Hash

Retrieves the ladders a profile is in.

Parameters:

  • id (Integer)

    The user's profile ID.

  • region (Integer)

    The region the user is in.

  • name (String)

    The name of the user's profile.

Returns:

  • (Hash)

    A hash containing the profile's ladder data.



24
25
26
# File 'lib/bnet_api/sc2.rb', line 24

def profile_ladders(id, region, name)
  BnetApi.make_request("/sc2/profile/#{id}/#{region}/#{name}/ladders")
end

#rewards_dataHash

Retrieves all rewards data.

Returns:

  • (Hash)

    A hash containing the rewards data.



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

def rewards_data
  BnetApi.make_request('/sc2/data/rewards')
end