ig-validator-utils 0.0.6 → 0.0.7
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/ig-validator-utils.rb +8 -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: 9a3903fda3c92fb706290cbac44b7cd212888775
|
4
|
+
data.tar.gz: 9b35463a9d4fe34097bcf3b0e1eeb51b70dd222e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8696097e0874e4edee90fc7a20f4e9e54900da5241e5b785003d39f68846c12c9a8c0d028326821a7dc28513f09ec4e67205ac15b4bb839ff02c1d713f6dc45
|
7
|
+
data.tar.gz: 6707fa4d002e69200d34a2f50346c6c7f80ad57b449fea520425896ddab36a15ca1f2b3cbfdff8e2073a2d79b2daaf5255c82456bb8c413613a97ffc56981546
|
data/lib/ig-validator-utils.rb
CHANGED
@@ -12,9 +12,16 @@ module ValidatorUtils
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# \p{L} matches a single unicode letter
|
15
|
-
# also allows points, apostrophe and hyphen
|
15
|
+
# also allows space, points, apostrophe and hyphen
|
16
16
|
def self.validate_string_strict(value)
|
17
17
|
value =~ /^[\p{L} .'-]+$/i
|
18
|
+
end
|
19
|
+
|
20
|
+
# \p{L} matches a single unicode letter
|
21
|
+
# \p{N} matches a single unicode number
|
22
|
+
# allow points, comma, apostrophe, hyphen, spaces
|
23
|
+
def self.validate_address(value)
|
24
|
+
value =~ /^[\p{L}\p{N} .,'-]+$/i
|
18
25
|
end
|
19
26
|
|
20
27
|
def self.validate_integer(value)
|