Module: BnetApi::OAuth

Extended by:
OAuth
Included in:
OAuth
Defined in:
lib/bnet_api/oauth.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#account_id(access_token) ⇒ Hash

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

Parameters:

  • access_token (String)

    The user's OAuth access token.

Returns:

  • (Hash)

    A hash containing the user's account ID.



10
11
12
# File 'lib/bnet_api/oauth.rb', line 10

def (access_token)
  BnetApi.make_request_oauth('/account/user/id', access_token)
end

#battletag(access_token) ⇒ Hash

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

Parameters:

  • access_token (String)

    The user's OAuth access token.

Returns:

  • (Hash)

    A hash containing the user's battletag.



18
19
20
# 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) ⇒ Hash

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

Parameters:

  • access_token (String)

    The user's OAuth access token.

Returns:

  • (Hash)

    A hash containing the user's Starcraft II profile data.



26
27
28
# 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) ⇒ Hash

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

Parameters:

  • access_token (String)

    The user's OAuth access token.

Returns:

  • (Hash)

    A hash containing the user's World of Warcraft profile data.



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

def wow_profile(access_token)
  BnetApi.make_request_oauth('/wow/user/characters', access_token)
end