wowget 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wowget.rb +1 -1
- data/lib/wowget/item.rb +33 -25
- data/spec/item_spec.rb +5 -1
- metadata +1 -1
data/lib/wowget.rb
CHANGED
data/lib/wowget/item.rb
CHANGED
@@ -161,31 +161,31 @@ module Wowget
|
|
161
161
|
}
|
162
162
|
}
|
163
163
|
INVENTORY_SLOTS = {
|
164
|
-
1 => 'Head',
|
165
|
-
2 => 'Neck',
|
166
|
-
3 => 'Shoulder',
|
167
|
-
4 => 'Shirt',
|
168
|
-
5 => 'Chest',
|
169
|
-
6 => 'Waist',
|
170
|
-
7 => 'Legs',
|
171
|
-
8 => 'Feet',
|
172
|
-
9 => 'Wrist',
|
173
|
-
10 => 'Hands',
|
174
|
-
11 => 'Finger',
|
175
|
-
12 => 'Trinket',
|
176
|
-
13 => 'One-Hand',
|
177
|
-
14 => 'Shield',
|
178
|
-
15 => 'Ranged',
|
179
|
-
16 => 'Back',
|
180
|
-
17 => 'Two-Hand',
|
181
|
-
18 => 'Bag',
|
182
|
-
19 => 'Tabard',
|
183
|
-
21 => 'Main Hand',
|
184
|
-
22 => 'Off Hand',
|
185
|
-
23 => 'Held In Off-hand',
|
186
|
-
24 => 'Projectile',
|
187
|
-
25 => 'Thrown',
|
188
|
-
28 => 'Relic'
|
164
|
+
1 => {:name => 'Head', :slug => 'head'},
|
165
|
+
2 => {:name => 'Neck', :slug => 'neck'},
|
166
|
+
3 => {:name => 'Shoulder', :slug => 'shoulder'},
|
167
|
+
4 => {:name => 'Shirt', :slug => 'shirt'},
|
168
|
+
5 => {:name => 'Chest', :slug => 'chest'},
|
169
|
+
6 => {:name => 'Waist', :slug => 'waist'},
|
170
|
+
7 => {:name => 'Legs', :slug => 'legs'},
|
171
|
+
8 => {:name => 'Feet', :slug => 'feet'},
|
172
|
+
9 => {:name => 'Wrist', :slug => 'wrist'},
|
173
|
+
10 => {:name => 'Hands', :slug => 'hands'},
|
174
|
+
11 => {:name => 'Finger', :slug => 'finger'},
|
175
|
+
12 => {:name => 'Trinket', :slug => 'trinket'},
|
176
|
+
13 => {:name => 'One-Hand', :slug => 'one_hand'},
|
177
|
+
14 => {:name => 'Shield', :slug => 'shield'},
|
178
|
+
15 => {:name => 'Ranged', :slug => 'ranged'},
|
179
|
+
16 => {:name => 'Back', :slug => 'back'},
|
180
|
+
17 => {:name => 'Two-Hand', :slug => 'two_hand'},
|
181
|
+
18 => {:name => 'Bag', :slug => 'bag'},
|
182
|
+
19 => {:name => 'Tabard', :slug => 'tabard'},
|
183
|
+
21 => {:name => 'Main Hand', :slug => 'main_hand'},
|
184
|
+
22 => {:name => 'Off Hand', :slug => 'off_hand'},
|
185
|
+
23 => {:name => 'Held In Off-hand', :slug => 'held_in_off_hand'},
|
186
|
+
24 => {:name => 'Projectile', :slug => 'projectile'},
|
187
|
+
25 => {:name => 'Thrown', :slug => 'thrown'},
|
188
|
+
28 => {:name => 'Relic', :slug => 'relic'}
|
189
189
|
}
|
190
190
|
|
191
191
|
def self.find(query)
|
@@ -298,6 +298,14 @@ module Wowget
|
|
298
298
|
INVENTORY_SLOTS[self.inventory_slot_id]
|
299
299
|
end
|
300
300
|
|
301
|
+
def inventory_slot_name
|
302
|
+
INVENTORY_SLOTS[self.inventory_slot_id][:name]
|
303
|
+
end
|
304
|
+
|
305
|
+
def inventory_slot_slug
|
306
|
+
INVENTORY_SLOTS[self.inventory_slot_id][:slug]
|
307
|
+
end
|
308
|
+
|
301
309
|
def to_link
|
302
310
|
color = case self.quality.downcase.to_sym
|
303
311
|
when :poor then 'white'
|
data/spec/item_spec.rb
CHANGED
@@ -58,7 +58,11 @@ describe Wowget::Item do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should have an inventory slot name" do
|
61
|
-
item.
|
61
|
+
item.inventory_slot_name.should == "Two-Hand"
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should have an inventory slot slug" do
|
65
|
+
item.inventory_slot_slug.should == "two_hand"
|
62
66
|
end
|
63
67
|
|
64
68
|
it "should have a required minimum level" do
|