zanders 5.0.4 → 5.0.5
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/zanders/catalog.rb +7 -1
- data/lib/zanders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52880c26700658916eeca8313e9b38cc85dba6234049a921a7bd6b053b1b36a8
|
|
4
|
+
data.tar.gz: 1dc7740edcac024a7c58123947412a5edf377bee4b8a32a31c903b12345a23db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5021674e822a990653da4d9e540941a7de1cbe495e2abd502744d384f50d24013120f86f8ae9c38bcce721572fe69d3551889735a52f3f0e675b4d7f92a65f93
|
|
7
|
+
data.tar.gz: 332fd8df0f24016d13c972e664bde5c2d27b77775b1b5465a0f2434262a6676fb19c9ce46d74a01b018a655e83df455dd66a580c454dbfa7ce03e4b039118896
|
data/lib/zanders/catalog.rb
CHANGED
|
@@ -39,13 +39,14 @@ module Zanders
|
|
|
39
39
|
|
|
40
40
|
def map_hash(node)
|
|
41
41
|
features = map_features(node)
|
|
42
|
+
sale_dates = [content_for(node, 'ITEMSALESTART'), content_for(node, 'ITEMSALEEND')]
|
|
42
43
|
|
|
43
44
|
{
|
|
44
45
|
name: content_for(node, 'ITEMDESCRIPTION'),
|
|
45
46
|
upc: content_for(node, 'ITEMUPC'),
|
|
46
47
|
item_identifier: content_for(node, 'ITEMNO'),
|
|
47
48
|
quantity: content_for(node, 'ITEMQTYAVAIL'),
|
|
48
|
-
price: content_for(node, 'ITEMPRICE'),
|
|
49
|
+
price: active_sale?(sale_dates) ? content_for(node, 'ITEMSALEPRICE') : content_for(node, 'ITEMPRICE'),
|
|
49
50
|
short_description: content_for(node, 'ITEMDESCRIPTION'),
|
|
50
51
|
category: content_for(node, 'ITEMCATEGORYNAME'),
|
|
51
52
|
mfg_number: content_for(node, 'ITEMMPN'),
|
|
@@ -70,5 +71,10 @@ module Zanders
|
|
|
70
71
|
features.symbolize_keys!
|
|
71
72
|
end
|
|
72
73
|
|
|
74
|
+
def active_sale?(sale_dates)
|
|
75
|
+
return false if !sale_dates.all?(&:present?)
|
|
76
|
+
|
|
77
|
+
Date.today.between?(Date.parse(sale_dates.first), Date.parse(sale_dates.second))
|
|
78
|
+
end
|
|
73
79
|
end
|
|
74
80
|
end
|
data/lib/zanders/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zanders
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.0.
|
|
4
|
+
version: 5.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Knight
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2023-
|
|
12
|
+
date: 2023-08-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: nokogiri
|