module BnetApi::WoW

All API methods relating to World of Warcraft are contained in this module.

Public Instance Methods

achievement(id) click to toggle source

Retrieves the achievement with the specified ID.

@param id [Integer] The ID of the achievement. @return [Hash] A hash containing the achievement data.

# File lib/bnet_api/wow.rb, line 12
def achievement(id)
  BnetApi.make_request("/wow/achievement/#{id}")
end
auction_data(realm) click to toggle source

Retrieves the URL of a JSON file containing the most recent auction data dump.

@param realm [String] The realm to retrieve auction data for. @return [Hash] A hash containing the URL of the auction data file.

# File lib/bnet_api/wow.rb, line 20
def auction_data(realm)
  BnetApi.make_request("/wow/auction/data/#{realm}")
end
challenge_mode_realm(realm) click to toggle source

Retrieves the challenge mode leaderboard for the specified realm.

@param realm [String] The realm to retrieve the leaderboard for. @return [Hash] A hash containing the leaderboard data.

# File lib/bnet_api/wow.rb, line 28
def challenge_mode_realm(realm)
  BnetApi.make_request("/wow/challenge/#{realm}")
end
challenge_mode_region() click to toggle source

Retrieves the challenge mode leaderboard for the current API region.

@return [Hash] A hash containing the leaderboard data.

# File lib/bnet_api/wow.rb, line 35
def challenge_mode_region
  BnetApi.make_request('/wow/challenge/region')
end
character(realm, name, *optional_fields) click to toggle source

Retrieves the character with the specified name on the specified realm.

@param realm [String] The realm the character is on. @param name [String] The name of the character. @param *optional_fields [Array<Symbol>] Any optional fields to retrieve data for. @return [Hash] A hash containing the character data.

# File lib/bnet_api/wow.rb, line 45
def character(realm, name, *optional_fields)
  if optional_fields[0] == :all
    optional_fields = :achievements, :appearance, :feed, :guild, :items, :mounts, :pets, :petSlots, :progression, :pvp, :quests, :reputation, :stats, :talents, :titles, :audit
  end
  BnetApi.make_request("/wow/character/#{URI.escape(realm)}/#{URI.escape(name)}", optional_fields)
end
guild(realm, name, *optional_fields) click to toggle source
item(id) click to toggle source

Retrieves the item with the specified ID.

@param id [Integer] The ID of the item. @return [Hash] A hash containing the item data.

# File lib/bnet_api/wow.rb, line 56
def item(id)
  BnetApi.make_request("/wow/item/#{id}")
end
item_set(id) click to toggle source

Retrieves the item set with the specified ID.

@param id [Integer] The ID of the item set. @return [Hash] A hash containing the item set data.

# File lib/bnet_api/wow.rb, line 64
def item_set(id)
  BnetApi.make_request("/wow/item/set/#{id}")
end
pet_ability(id) click to toggle source

Retrieves the pet ability with the specified ID.

@param id [Integer] The ID of the ability. @return [Hash] A hash containing the ability data.

# File lib/bnet_api/wow.rb, line 92
def pet_ability(id)
  BnetApi.make_request("/wow/pet/ability/#{id}")
end
pet_master_list() click to toggle source

Retrieves a list of all battle and vanity pets.

@return [Hash] A hash containing a list of pets.

# File lib/bnet_api/wow.rb, line 84
def pet_master_list
  BnetApi.make_request("/wow/pet/")
end
pet_species(id) click to toggle source

Retrieves the pet species with the specified ID.

@param id [Integer] The ID of the species. @return [Hash] A hash containing the species data.

# File lib/bnet_api/wow.rb, line 100
def pet_species(id)
  BnetApi.make_request("/wow/pet/species/#{id}")
end
pet_stats(species_id, options = {}) click to toggle source

Retrieves the stats for the pet with the specified ID.

@param species_id [Integer] The ID of the pet species. @param options [Hash] Any additional options. @option options [Integer] :level The level of the species. @option options [Integer] :breedId The ID of the breed. @option options [Integer] :qualityId The quality of the pet. @return [Hash] A hash containing the pet stats data.

# File lib/bnet_api/wow.rb, line 112
def pet_stats(species_id, options = {})
  level = options[:level] || 1
  breedId = options[:breedId] || 3
  qualityId = options[:qualityId] || 1

  BnetApi.make_request_with_params("/wow/pet/stats/#{species_id}",
    { 
      level: level, 
      breedId: breedId, 
      qualityId: qualityId }
  )
end
pvp(bracket) click to toggle source

Retrieves the PvP leaderboard for the specified bracket.

@param bracket [String] The PvP bracket to retrieve data for. @return [Hash] A hash containing the leaderboard data.

# File lib/bnet_api/wow.rb, line 129
def pvp(bracket)
  BnetApi.make_request("/wow/leaderboard/#{bracket}")
end
quest(id) click to toggle source

Retrieves the quest with the specified ID.

@param id [Integer] The ID of the quest. @return [Hash] A hash containing the quest data.

# File lib/bnet_api/wow.rb, line 137
def quest(id)
  BnetApi.make_request("/wow/quest/#{id}")
end
realm_status(*realms) click to toggle source

Retrieves the realm status for the region. If any realms are specified as parameters, only the status of these realms will be returned.

@param *realms [Array<String>] Any realms to restrict the data to. @return [Hash] A hash containing the realm status data.

# File lib/bnet_api/wow.rb, line 146
def realm_status(*realms)
  if realms.count > 0
    BnetApi.make_request_with_params("/wow/realm/status", { realms: realms.join(',') })
  else
    BnetApi.make_request("/wow/realm/status")
  end
end
recipe(id) click to toggle source

Retrieves the recipe with the specified ID.

@param id [Integer] The ID of the recipe. @return [Hash] A hash containing the recipe data.

# File lib/bnet_api/wow.rb, line 158
def recipe(id)
  BnetApi.make_request("/wow/recipe/#{id}")
end
spell(id) click to toggle source

Retrieves the spell with the specified ID.

@param id [Integer] The ID of the spell. @return [Hash] A hash containing the spell data.

# File lib/bnet_api/wow.rb, line 166
def spell(id)
  BnetApi.make_request("/wow/spell/#{id}")
end