wowget 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/wowget/item.rb +6 -7
- metadata +1 -1
data/lib/wowget/item.rb
CHANGED
|
@@ -21,8 +21,8 @@ module Wowget
|
|
|
21
21
|
attr_accessor :recipe_id
|
|
22
22
|
attr_accessor :error
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
QUALITIES = ['Poor', 'Common', 'Uncommon', 'Rare', 'Epic', 'Legendary', 'Artifact', 'Heirloom']
|
|
25
|
+
CATEGORIES = {
|
|
26
26
|
0 => 'Consumables',
|
|
27
27
|
1 => 'Containers',
|
|
28
28
|
2 => 'Weapons',
|
|
@@ -36,7 +36,7 @@ module Wowget
|
|
|
36
36
|
15 => 'Miscellaneous',
|
|
37
37
|
16 => 'Glyphs'
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
SUBCATEGORIES = {
|
|
40
40
|
'Consumables' => {
|
|
41
41
|
0 => 'Consumables',
|
|
42
42
|
1 => 'Potions',
|
|
@@ -205,7 +205,6 @@ module Wowget
|
|
|
205
205
|
end
|
|
206
206
|
end
|
|
207
207
|
|
|
208
|
-
|
|
209
208
|
if item_id
|
|
210
209
|
item_xml = Nokogiri::XML(open("http://www.wowhead.com/item=#{item_id}&xml"))
|
|
211
210
|
if item_xml.css('wowhead error').length == 1
|
|
@@ -238,15 +237,15 @@ module Wowget
|
|
|
238
237
|
end
|
|
239
238
|
|
|
240
239
|
def quality
|
|
241
|
-
|
|
240
|
+
QUALITIES[self.quality_id]
|
|
242
241
|
end
|
|
243
242
|
|
|
244
243
|
def category
|
|
245
|
-
|
|
244
|
+
CATEGORIES[self.category_id]
|
|
246
245
|
end
|
|
247
246
|
|
|
248
247
|
def subcategory
|
|
249
|
-
|
|
248
|
+
SUBCATEGORIES[self.category][self.subcategory_id]
|
|
250
249
|
end
|
|
251
250
|
|
|
252
251
|
def inventory_slot
|