class BlizzardApi::Diablo::Profile

This class allows access to Diablo III profile data

@see develop.battle.net/documentation/api-reference/diablo-3-community-api

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

api_instance = BlizzardApi::Diablo.profile

Public Instance Methods

hero(battletag, oauth_token, hero_id, **options) click to toggle source

Return more data about a hero

@param battletag [String] User's battletag @param oauth_token [String] A token generated by the OAuth authorization flow. See the link below for more info. @param hero_id [Integer] Hero id @!macro request_options

@!macro response

@see develop.battle.net/documentation/guides/using-oauth/authorization-code-flow

# File lib/blizzard_api/diablo/community/profile.rb, line 39
def hero(battletag, oauth_token, hero_id, **options)
  opts = { access_token: oauth_token, ttl: CACHE_TRIMESTER }.merge(options)
  api_request "#{base_url(:community)}/profile/#{parse_battle_tag(battletag)}/hero/#{hero_id}", **opts
end
hero_follower_items(battletag, oauth_token, hero_id, **options) click to toggle source

Return more data about a hero's followers

@param battletag [String] User's battletag @param oauth_token [String] A token generated by the OAuth authorization flow. See the link below for more info. @param hero_id [Integer] Hero id @!macro request_options

@!macro response

@see develop.battle.net/documentation/guides/using-oauth/authorization-code-flow

# File lib/blizzard_api/diablo/community/profile.rb, line 71
def hero_follower_items(battletag, oauth_token, hero_id, **options)
  opts = { access_token: oauth_token, ttl: CACHE_TRIMESTER }.merge(options)
  api_request "#{base_url(:community)}/profile/#{parse_battle_tag(battletag)}/hero/#{hero_id}/follower-items", **opts
end
hero_items(battletag, oauth_token, hero_id, **options) click to toggle source

Return more data about a hero's items

@param battletag [String] User's battletag @param oauth_token [String] A token generated by the OAuth authorization flow. See the link below for more info. @param hero_id [Integer] Hero id @!macro request_options

@!macro response

@see develop.battle.net/documentation/guides/using-oauth/authorization-code-flow

# File lib/blizzard_api/diablo/community/profile.rb, line 55
def hero_items(battletag, oauth_token, hero_id, **options)
  opts = { access_token: oauth_token, ttl: CACHE_TRIMESTER }.merge(options)
  api_request "#{base_url(:community)}/profile/#{parse_battle_tag(battletag)}/hero/#{hero_id}/items", **opts
end
index(battletag, oauth_token, **options) click to toggle source

Return an user's profile data with a list of heroes

@param battletag [String] User's battletag @param oauth_token [String] A token generated by the OAuth authorization flow. See the link below for more info. @!macro request_options

@!macro response

@see develop.battle.net/documentation/guides/using-oauth/authorization-code-flow

# File lib/blizzard_api/diablo/community/profile.rb, line 23
def index(battletag, oauth_token, **options)
  opts = { access_token: oauth_token, ttl: CACHE_TRIMESTER }.merge(options)
  api_request "#{base_url(:community)}/profile/#{parse_battle_tag(battletag)}/", **opts
end

Private Instance Methods

parse_battle_tag(battletag) click to toggle source
# File lib/blizzard_api/diablo/community/profile.rb, line 78
def parse_battle_tag(battletag)
  battletag.sub('#', '-')
end