Class: Warcraft::Account::Profile

Inherits:
Warcraft::ApiRequest show all
Defined in:
lib/warcraft/account/profile.rb

Overview

Returns Blizzard Battle.net Account ID.

Returns:

  • (Integer)

    Blizzard Battle.net Account ID

Instance Method Summary collapse

Methods inherited from Warcraft::ApiRequest

#get, #initialize

Constructor Details

This class inherits a constructor from Warcraft::ApiRequest

Instance Method Details

#all_charactersObject



16
17
18
19
20
# File 'lib/warcraft/account/profile.rb', line 16

def all_characters
  @response[:wow_accounts].map(:characters).flatten.map do |c|
    Fragments::AccountCharacterFragment.new(@client, c)
  end
end

#collectionsObject



8
9
10
# File 'lib/warcraft/account/profile.rb', line 8

def collections
  link
end

#idInteger

Returns Blizzard Battle.net Account ID.

Returns:

  • (Integer)

    Blizzard Battle.net Account ID



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/warcraft/account/profile.rb', line 7

class Profile < ApiRequest
  def collections
    link
  end

  def wow_accounts
    @wow_accounts ||= WowAccount.new(@client, @response[:wow_accounts])
  end

  def all_characters
    @response[:wow_accounts].map(:characters).flatten.map do |c|
      Fragments::AccountCharacterFragment.new(@client, c)
    end
  end
end

#wow_accountsObject



12
13
14
# File 'lib/warcraft/account/profile.rb', line 12

def wow_accounts
  @wow_accounts ||= WowAccount.new(@client, @response[:wow_accounts])
end