active_stripper 0.1.1 → 0.2.0
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/active_stripper/helpers.rb +13 -0
- data/lib/active_stripper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a002ba180aa3144b7177458f3a061e9dfa118170
|
4
|
+
data.tar.gz: 40d3ed0bcd9c125b07d3c11f7835db92598932fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f8c57f9ac4c478eb9592679fb226c7f41cc7e01959a9572fbebcb91dbe0196cbb349cb53be917f1808f96e7ad2ca13458ec5dcaf8b4c82a2e079d94a5f6ae2f
|
7
|
+
data.tar.gz: 034942b8eb6d0e0307d9da20180f0a526bc9e8ccb84fc22bee2968be9ecffb826f06aa6e4700618b7df3bb738eddd5e30250ee7020162a70664098665e92148b
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# Any helper processor in this module need to have their first argument set to contain
|
2
|
+
# to value to be processed
|
1
3
|
module ActiveStripper
|
2
4
|
module Helpers
|
3
5
|
class << self
|
@@ -62,6 +64,17 @@ module ActiveStripper
|
|
62
64
|
return val.downcase
|
63
65
|
end
|
64
66
|
|
67
|
+
#
|
68
|
+
# Set value to nil if val is an empty string
|
69
|
+
#
|
70
|
+
# @param [String] val String to evaluate
|
71
|
+
#
|
72
|
+
# @return [String/Nil] Return @val if not empty otherwise return nil
|
73
|
+
#
|
74
|
+
def empty_string_to_nil(val)
|
75
|
+
return if !val || val == ""
|
76
|
+
return val
|
77
|
+
end
|
65
78
|
end
|
66
79
|
end
|
67
80
|
end
|