cellar 0.2.0 → 0.2.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/cellar.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cec8c74c1ac06565b7f325100c42d170feaa8bcbd83734f713c3a4d721f0cbf
|
4
|
+
data.tar.gz: 3403ae1a85d904ffe717ce70e7a74e4bdaec3a9a95abb11e3aa72e499db4bb12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8db25ee26837b86486b09db2e9bb4c763391c1c910f9e4a906659219ce6b88cccee20fec9e76f939e1835846fe9361e7a44082a40129b4fc9cc2103543e4962d
|
7
|
+
data.tar.gz: b80b8af43331bd3120fee05da3b51d31c7a8ad3ac6f4bcd5f7f107e8750d239b9151198dd07dcd60ba3f25b02fe98eaba21db689d3912f4c298bf40147174db7
|
data/lib/cellar.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# cellar - Ruby gem to deal with cells of data in rows and columns
|
3
3
|
#
|
4
4
|
# Author: Steve Shreeve (steve.shreeve@gmail.com)
|
5
|
-
# Date: October
|
5
|
+
# Date: October 19, 2024
|
6
6
|
#
|
7
7
|
# TODO:
|
8
8
|
# • Should we failover to empty strings like this: (value || "")
|
@@ -28,7 +28,7 @@ class Object
|
|
28
28
|
end
|
29
29
|
|
30
30
|
class Cellar
|
31
|
-
VERSION="0.2.
|
31
|
+
VERSION="0.2.1"
|
32
32
|
|
33
33
|
attr_reader :fields
|
34
34
|
attr_reader :values
|
@@ -238,7 +238,11 @@ class Cellar
|
|
238
238
|
field = data.fields[idx]
|
239
239
|
index = index(field) || add_field(field)
|
240
240
|
value = @values[index]
|
241
|
-
|
241
|
+
if block && !value.blank?
|
242
|
+
val = block.call(value, val)
|
243
|
+
next if val.blank?
|
244
|
+
end
|
245
|
+
@values[index] = val
|
242
246
|
end
|
243
247
|
self
|
244
248
|
end
|