module BnetApi::OAuth

All API methods requiring OAuth authentication are contained in this module.

Public Instance Methods

account_id(access_token) click to toggle source

Retrieves the account ID number for the user with the specified access token.

@param access_token [String] The user's OAuth access token. @return [Hash] A hash containing the user's account ID.

# File lib/bnet_api/oauth.rb, line 10
def account_id(access_token)
  BnetApi.make_request_oauth('/account/user/id', access_token)
end
battletag(access_token) click to toggle source

Retrieves the battletag for the user with the specified access token.

@param access_token [String] The user's OAuth access token. @return [Hash] A hash containing the user's battletag.

# File lib/bnet_api/oauth.rb, line 18
def battletag(access_token)
  BnetApi.make_request_oauth('/account/user/battletag', access_token)
end
sc2_profile(access_token) click to toggle source

Retrieves the Starcraft II profile for the user with the specified access token.

@param access_token [String] The user's OAuth access token. @return [Hash] A hash containing the user's Starcraft II profile data.

# File lib/bnet_api/oauth.rb, line 26
def sc2_profile(access_token)
  BnetApi.make_request_oauth('/sc2/profile/user', access_token)
end
wow_profile(access_token) click to toggle source

Retrieves the World of Warcraft profile for the user with the specified access token.

@param access_token [String] The user's OAuth access token. @return [Hash] A hash containing the user's World of Warcraft profile data.

# File lib/bnet_api/oauth.rb, line 34
def wow_profile(access_token)
  BnetApi.make_request_oauth('/wow/user/characters', access_token)
end