scrubdeku 0.1.0 → 0.1.1
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/lib/{SCRuB.rb → scrubdeku.rb} +20 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e116be245956154885bc61a5d7f3effed975375c
|
4
|
+
data.tar.gz: 94bc304c8155951f0598af0801d9b56a5ccac829
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c7d6f4756aa984567ca755e0c991de5c41f6099f88f29d878e2248e19cfacb30504ede186af2552b0427aad866b9792bd6aa892c915de32cb1684d2ac966ba
|
7
|
+
data.tar.gz: dc168fb61184f2c77afff395472ef5273e5f5815c9133e2fff2e45ad0fc5ba40b01a7d9063c9785b9802581590764d6a474221950df569377b28f13826ddd9c3
|
@@ -127,21 +127,35 @@ module Scrub
|
|
127
127
|
|
128
128
|
def products
|
129
129
|
productTable = {}
|
130
|
-
|
131
|
-
|
130
|
+
|
131
|
+
orderData = @data[:orders_get_data_response][:orders_get_data_result][:order][:items][:order_item]
|
132
|
+
if orderData.kind_of? Array
|
133
|
+
orderData.each do |item|
|
134
|
+
productTable[item[:product_id]] = {"qty" => item[:qty], "description" => item[:display_name]}
|
135
|
+
end
|
136
|
+
elsif orderData.kind_of? Hash
|
137
|
+
productTable[orderData[:product_id]] = {"qty" => orderData[:qty], "description" => orderData[:display_name]}
|
132
138
|
end
|
133
139
|
return productTable
|
134
140
|
end
|
135
141
|
|
136
142
|
def kit_listing
|
137
143
|
productTable = {}
|
138
|
-
@data[:orders_get_data_response][:orders_get_data_result][:order][:items][:order_item]
|
144
|
+
orderData = @data[:orders_get_data_response][:orders_get_data_result][:order][:items][:order_item]
|
145
|
+
if orderData.kind_of? Array
|
146
|
+
buildout = {}
|
147
|
+
orderData.each do |item|
|
148
|
+
item[:bundle_items][:order_bundle_item].each do |bundleItem|
|
149
|
+
buildout.merge!("#{bundleItem[:product_id]}" => {'qtyEach' => bundleItem[:qty], 'qtyTotal' => bundleItem[:total_qty]})
|
150
|
+
end
|
151
|
+
productTable[item[:product_id]] = {"qty" => item[:qty], "description" => item[:display_name], 'components' => buildout}
|
152
|
+
end
|
153
|
+
elsif orderData.kind_of? Hash
|
139
154
|
buildout = {}
|
140
|
-
|
141
|
-
item[:bundle_items][:order_bundle_item].each do |bundleItem|
|
155
|
+
orderData[:bundle_items][:order_bundle_item].each do |bundleItem|
|
142
156
|
buildout.merge!("#{bundleItem[:product_id]}" => {'qtyEach' => bundleItem[:qty], 'qtyTotal' => bundleItem[:total_qty]})
|
143
157
|
end
|
144
|
-
productTable[
|
158
|
+
productTable[orderData[:product_id]] = {"qty" => orderData[:qty], "description" => orderData[:display_name], 'components' => buildout}
|
145
159
|
end
|
146
160
|
return productTable
|
147
161
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrubdeku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harold Schreckengost
|
@@ -37,7 +37,7 @@ executables: []
|
|
37
37
|
extensions: []
|
38
38
|
extra_rdoc_files: []
|
39
39
|
files:
|
40
|
-
- lib/
|
40
|
+
- lib/scrubdeku.rb
|
41
41
|
homepage: https://github.com/hschreck/SCRuB
|
42
42
|
licenses:
|
43
43
|
- MIT
|