omniorder 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/omniorder/orderable.rb +4 -0
- data/lib/omniorder/version.rb +1 -1
- data/spec/orderable_spec.rb +9 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfae2f7483a5c303444e3d0f59987776fcaa3d20
|
4
|
+
data.tar.gz: 26581a65ffaf0f5ea468b59ebaf508e5939122da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78fbb036cc9090c5c72b3b67d0437621dfe2579811799025bc2f41a4fc207ed271eebd79bd42a711c30be4aca517df9d70c0254906eb95659b7410c7e1735c90
|
7
|
+
data.tar.gz: ce6373ee0ae5ce0cbcf56052fb891b60d4b3dfe061156e0b2384a9312c2b10a9aaa3c9b0d97ad9ca60ee37d341ed5f364015b67ff50631597a937ee36237708b
|
data/.travis.yml
CHANGED
data/lib/omniorder/orderable.rb
CHANGED
@@ -31,6 +31,10 @@ module Omniorder
|
|
31
31
|
order_products.inject(0) { |sum, op| sum + op.quantity }
|
32
32
|
end
|
33
33
|
|
34
|
+
def unique_product_count
|
35
|
+
order_products.count
|
36
|
+
end
|
37
|
+
|
34
38
|
# Human-readable string representing order products
|
35
39
|
def product_list
|
36
40
|
order_products.sort.map(&:to_s).join('/')
|
data/lib/omniorder/version.rb
CHANGED
data/spec/orderable_spec.rb
CHANGED
@@ -44,6 +44,15 @@ describe Omniorder::Orderable do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
describe '#unique_product_count' do
|
48
|
+
it 'is the number of order_product lines' do
|
49
|
+
order.add_product_by_code('CODE1', 10)
|
50
|
+
order.add_product_by_code('CODE2', 6)
|
51
|
+
|
52
|
+
expect(order.unique_product_count).to eq(2)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
47
56
|
describe '#product_list' do
|
48
57
|
it 'is a human-readable string representing order products' do
|
49
58
|
order.add_product_by_code('CODE1', 10)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniorder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Howard Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01
|
11
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: crack
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
152
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.4.6
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: Import online orders from various channels for fulfillment.
|