warehouse_items 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/warehouse/random.rb +1 -1
- data/lib/warehouse/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98e337833a9d62456fe917317e31ba5b7920a8d8
|
4
|
+
data.tar.gz: fd67a7f10709c72beb1b0724dc8da69333044504
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2df7dbdf07b08217e35ed6db18bdee06fba51111777a371234592ff7246e5ffdaee5bd81dfcaf2ff004eb7dd2806cdf640cbe40aa1fa37e39129fb93840ea56e
|
7
|
+
data.tar.gz: 8f8954b931cd2003ba30837e81a3dc04fb74f1cceab52d663d0d9ed4fb8e15d281c4cea311511d174d93ac37d721e90bac83e2f41bb6ece13ea27abcdc3bbbd1
|
data/lib/warehouse/random.rb
CHANGED
@@ -22,7 +22,7 @@ class Warehouse::Random < Struct.new(:items, :qty)
|
|
22
22
|
random_items = {}
|
23
23
|
(1..qty).each do
|
24
24
|
item = items.sample
|
25
|
-
random_items[item.code]
|
25
|
+
random_items[item.code] ||= Warehouse::Item.new(item.code, item.title, 0, item.price)
|
26
26
|
random_items[item.code].qty += 1
|
27
27
|
end
|
28
28
|
Warehouse::List.new(random_items.values)
|
data/lib/warehouse/version.rb
CHANGED