Module: BnetApi::WoW
Overview
All API methods relating to World of Warcraft are contained in this module.
Defined Under Namespace
Modules: Data
Instance Method Summary collapse
-
#achievement(id) ⇒ Hash
Retrieves the achievement with the specified ID.
-
#auction_data(realm) ⇒ Hash
Retrieves the URL of a JSON file containing the most recent auction data dump.
-
#challenge_mode_realm(realm) ⇒ Hash
Retrieves the challenge mode leaderboard for the specified realm.
-
#challenge_mode_region ⇒ Hash
Retrieves the challenge mode leaderboard for the current API region.
-
#character(realm, name, *optional_fields) ⇒ Hash
Retrieves the character with the specified name on the specified realm.
-
#guild(realm, name, *optional_fields) ⇒ Hash
Retrieves the guild with the specified name on the specified realm.
-
#item(id) ⇒ Hash
Retrieves the item with the specified ID.
-
#item_set(id) ⇒ Hash
Retrieves the item set with the specified ID.
-
#pet_ability(id) ⇒ Hash
Retrieves the pet ability with the specified ID.
-
#pet_master_list ⇒ Hash
Retrieves a list of all battle and vanity pets.
-
#pet_species(id) ⇒ Hash
Retrieves the pet species with the specified ID.
-
#pet_stats(species_id, options = {}) ⇒ Hash
Retrieves the stats for the pet with the specified ID.
-
#pvp(bracket) ⇒ Hash
Retrieves the PvP leaderboard for the specified bracket.
-
#quest(id) ⇒ Hash
Retrieves the quest with the specified ID.
-
#realm_status(*realms) ⇒ Hash
Retrieves the realm status for the region.
-
#recipe(id) ⇒ Hash
Retrieves the recipe with the specified ID.
-
#spell(id) ⇒ Hash
Retrieves the spell with the specified ID.
Instance Method Details
#achievement(id) ⇒ Hash
Retrieves the achievement with the specified ID.
12 13 14 |
# File 'lib/bnet_api/wow.rb', line 12 def achievement(id) BnetApi.make_request("/wow/achievement/#{id}") end |
#auction_data(realm) ⇒ Hash
Retrieves the URL of a JSON file containing the most recent auction data dump.
20 21 22 |
# File 'lib/bnet_api/wow.rb', line 20 def auction_data(realm) BnetApi.make_request("/wow/auction/data/#{realm}") end |
#challenge_mode_realm(realm) ⇒ Hash
Retrieves the challenge mode leaderboard for the specified realm.
28 29 30 |
# File 'lib/bnet_api/wow.rb', line 28 def challenge_mode_realm(realm) BnetApi.make_request("/wow/challenge/#{realm}") end |
#challenge_mode_region ⇒ Hash
Retrieves the challenge mode leaderboard for the current API region.
35 36 37 |
# File 'lib/bnet_api/wow.rb', line 35 def challenge_mode_region BnetApi.make_request('/wow/challenge/region') end |
#character(realm, name, *optional_fields) ⇒ Hash
Retrieves the character with the specified name on the specified realm.
45 46 47 48 49 50 |
# 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) ⇒ Hash
Retrieves the guild with the specified name on the specified realm.
74 75 76 77 78 79 |
# File 'lib/bnet_api/wow.rb', line 74 def guild(realm, name, *optional_fields) if optional_fields[0] == :all optional_fields = :members, :achievements, :news, :challenge end BnetApi.make_request("/wow/guild/#{URI.escape(realm)}/#{URI.escape(name)}", optional_fields) end |
#item(id) ⇒ Hash
Retrieves the item with the specified ID.
56 57 58 |
# File 'lib/bnet_api/wow.rb', line 56 def item(id) BnetApi.make_request("/wow/item/#{id}") end |
#item_set(id) ⇒ Hash
Retrieves the item set with the specified ID.
64 65 66 |
# File 'lib/bnet_api/wow.rb', line 64 def item_set(id) BnetApi.make_request("/wow/item/set/#{id}") end |
#pet_ability(id) ⇒ Hash
Retrieves the pet ability with the specified ID.
92 93 94 |
# File 'lib/bnet_api/wow.rb', line 92 def pet_ability(id) BnetApi.make_request("/wow/pet/ability/#{id}") end |
#pet_master_list ⇒ Hash
Retrieves a list of all battle and vanity pets.
84 85 86 |
# File 'lib/bnet_api/wow.rb', line 84 def pet_master_list BnetApi.make_request("/wow/pet/") end |
#pet_species(id) ⇒ Hash
Retrieves the pet species with the specified ID.
100 101 102 |
# 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 = {}) ⇒ Hash
Retrieves the stats for the pet with the specified ID.
112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/bnet_api/wow.rb', line 112 def pet_stats(species_id, = {}) level = [:level] || 1 breedId = [:breedId] || 3 qualityId = [:qualityId] || 1 BnetApi.make_request_with_params("/wow/pet/stats/#{species_id}", { level: level, breedId: breedId, qualityId: qualityId } ) end |
#pvp(bracket) ⇒ Hash
Retrieves the PvP leaderboard for the specified bracket.
129 130 131 |
# File 'lib/bnet_api/wow.rb', line 129 def pvp(bracket) BnetApi.make_request("/wow/leaderboard/#{bracket}") end |
#quest(id) ⇒ Hash
Retrieves the quest with the specified ID.
137 138 139 |
# File 'lib/bnet_api/wow.rb', line 137 def quest(id) BnetApi.make_request("/wow/quest/#{id}") end |
#realm_status(*realms) ⇒ Hash
Retrieves the realm status for the region. If any realms are specified as parameters, only the status of these realms will be returned.
146 147 148 149 150 151 152 |
# 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) ⇒ Hash
Retrieves the recipe with the specified ID.
158 159 160 |
# File 'lib/bnet_api/wow.rb', line 158 def recipe(id) BnetApi.make_request("/wow/recipe/#{id}") end |
#spell(id) ⇒ Hash
Retrieves the spell with the specified ID.
166 167 168 |
# File 'lib/bnet_api/wow.rb', line 166 def spell(id) BnetApi.make_request("/wow/spell/#{id}") end |