wowget 0.1.7 → 0.1.8
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/spell.rb +21 -0
- data/spec/spell_spec.rb +1 -0
- metadata +1 -1
data/lib/wowget/spell.rb
CHANGED
@@ -8,6 +8,7 @@ module Wowget
|
|
8
8
|
attr_accessor :item_id
|
9
9
|
attr_accessor :reagents
|
10
10
|
attr_accessor :profession
|
11
|
+
attr_accessor :profession_id
|
11
12
|
attr_accessor :skill
|
12
13
|
attr_accessor :error
|
13
14
|
|
@@ -45,6 +46,26 @@ module Wowget
|
|
45
46
|
p = spell_xml.xpath("//script[contains(., 'Markup')]").inner_text.scan(/\[ul\]\[li\](.+?)\[\/li\]/)[0][0].scan(/Requires (.+?) \(([0-9]+?)\)/)[0]
|
46
47
|
self.profession = p[0]
|
47
48
|
self.skill = p[1].to_i
|
49
|
+
|
50
|
+
self.profession_id = case self.profession
|
51
|
+
when "Alchemy" then 1
|
52
|
+
when "Blacksmithing" then 2
|
53
|
+
when "Cooking" then 3
|
54
|
+
when "Enchanting" then 4
|
55
|
+
when "Engineering" then 5
|
56
|
+
when "First Aid" then 6
|
57
|
+
when "Jewelcrafting" then 7
|
58
|
+
when "Leatherworking" then 8
|
59
|
+
when "Mining" then 9
|
60
|
+
when "Tailoring" then 10
|
61
|
+
when "Yes" then 11
|
62
|
+
when "No" then 12
|
63
|
+
when "Fishing" then 13
|
64
|
+
when "Herbalism" then 14
|
65
|
+
when "Inscription" then 15
|
66
|
+
when "Archaeology" then 16
|
67
|
+
end
|
68
|
+
|
48
69
|
end
|
49
70
|
end
|
50
71
|
end
|
data/spec/spell_spec.rb
CHANGED