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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25d4f55b08eaebc9d72536240bd555fc79fad450
4
- data.tar.gz: 56e00e0ff8b2167707af223935d7dde356748f7b
3
+ metadata.gz: 98e337833a9d62456fe917317e31ba5b7920a8d8
4
+ data.tar.gz: fd67a7f10709c72beb1b0724dc8da69333044504
5
5
  SHA512:
6
- metadata.gz: 186058952fdea0c1fa8873fa5f0f46b8800042cbc1428f1d2f50036b19aca3f71c17c355004f06f6274bebe46218cb8c0304042e3283e349260103473ff7e16d
7
- data.tar.gz: fc19a7571d00d2827a2086940cd04fd35532468c97a05a6129f416439d6aea948831668878b77d3c7a005cbde6b80a9b16a4e6aa46728fbbb675efc82ad9ce95
6
+ metadata.gz: 2df7dbdf07b08217e35ed6db18bdee06fba51111777a371234592ff7246e5ffdaee5bd81dfcaf2ff004eb7dd2806cdf640cbe40aa1fa37e39129fb93840ea56e
7
+ data.tar.gz: 8f8954b931cd2003ba30837e81a3dc04fb74f1cceab52d663d0d9ed4fb8e15d281c4cea311511d174d93ac37d721e90bac83e2f41bb6ece13ea27abcdc3bbbd1
@@ -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] = Warehouse::Item.new(item.code, item.title, 0, item.price)
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)
@@ -1,3 +1,3 @@
1
1
  module Warehouse
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warehouse_items
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eddie Li