useful_string_extensions 0.0.14 → 0.0.15
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.
@@ -126,10 +126,22 @@ class String
|
|
126
126
|
!(self =~ CustomEmailValidator.email_regex).nil?
|
127
127
|
end
|
128
128
|
|
129
|
+
def is_valid_phone?
|
130
|
+
!(self =~ CustomPhoneValidator.world_phone_regex).nil?
|
131
|
+
end
|
132
|
+
|
133
|
+
def is_valid_phone_from_sng?
|
134
|
+
!(self =~ CustomPhoneValidator.sng_phone_regex).nil?
|
135
|
+
end
|
136
|
+
|
129
137
|
def is_valid_phone_from_russia?
|
130
138
|
!(self =~ CustomPhoneValidator.russian_phone_regex).nil?
|
131
139
|
end
|
132
140
|
|
141
|
+
def is_valid_phone_from_ukrain?
|
142
|
+
!(self =~ CustomPhoneValidator.ukrainian_phone_regex).nil?
|
143
|
+
end
|
144
|
+
|
133
145
|
def normalize_phone
|
134
146
|
self == "" ? "" : self.gsub(/\D+/,'')
|
135
147
|
end
|
@@ -142,5 +154,4 @@ class String
|
|
142
154
|
}
|
143
155
|
self == "" ? "" : Sanitize.clean(self, allowed_tags)
|
144
156
|
end
|
145
|
-
|
146
157
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useful_string_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chardet
|