phone_number_validator 0.7.7 → 0.7.8
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28b96060524df2d557dd8b6db8d3a16e5235ef9b218d06cff8ed65c6cc127980
|
4
|
+
data.tar.gz: c609af773109b9c6ce602d7c120666da27017b8e8c7fecc5589f1ab1532d2e2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ed5eecbb04b67c90ee43e142e46eaa27974bb3a049ac84788029e03bb045ef5d73e2e4d4ffe37ef72640efc94af78604c2dccb34bf81ad649b286c2ba26961
|
7
|
+
data.tar.gz: 50384857b4e2e9211143dd5c7901f1573c746cec20d427b758f42295718e83b7cdd7aec7580ec004863a9011b2198202c2f71ecddb05eb26e632e4b8acf30c93
|
@@ -143,7 +143,7 @@ documentation's home page</p>
|
|
143
143
|
|
144
144
|
<div class="method-description">
|
145
145
|
|
146
|
-
<p>
|
146
|
+
<p>Initializes the <strong>@phone_number</strong> instance variable</p>
|
147
147
|
|
148
148
|
|
149
149
|
|
@@ -187,16 +187,13 @@ documentation's home page</p>
|
|
187
187
|
<p>Checks to see if the phone number the user entered is valid by testing
|
188
188
|
regex the pattern with the phone number</p>
|
189
189
|
|
190
|
-
<p><strong>Return Type:</strong
|
191
|
-
|
192
|
-
<pre class="ruby"><span class="ruby-identifier">boolean</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">symbol</span>
|
193
|
-
</pre>
|
190
|
+
<p><strong>Return Type:</strong> boolean or symbol</p>
|
194
191
|
|
195
192
|
|
196
193
|
|
197
194
|
|
198
195
|
<div class="method-source-code" id="validate-source">
|
199
|
-
<pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line
|
196
|
+
<pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line 24</span>
|
200
197
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate</span>
|
201
198
|
<span class="ruby-keyword">if</span> (<span class="ruby-ivar">@phone_number</span>.<span class="ruby-identifier">match</span>(<span class="ruby-constant">PHONE_NUMBER_REGEX</span>))
|
202
199
|
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
|
data/doc/created.rid
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Sun, 25 Nov 2018 12:
|
1
|
+
Sun, 25 Nov 2018 12:49:31 -0800
|
2
2
|
README.rdoc Sun, 25 Nov 2018 12:24:18 -0800
|
3
3
|
lib/phone_number_validator.rb Sun, 25 Nov 2018 11:28:37 -0800
|
4
|
-
lib/phone_number_validator/validator.rb Sun, 25 Nov 2018
|
4
|
+
lib/phone_number_validator/validator.rb Sun, 25 Nov 2018 12:49:19 -0800
|
5
5
|
test/test_phone_number_validator.rb Sun, 25 Nov 2018 11:28:37 -0800
|
6
6
|
bin/pnv Sun, 25 Nov 2018 12:14:53 -0800
|
data/doc/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["phonenumbervalidator","validator","phonenumbervalidatortest","new()","test_invalid_phone_number()","test_no_phone_number()","test_valid_phone_number()","validate()","validate()","readme"],"longSearchIndex":["phonenumbervalidator","phonenumbervalidator::validator","phonenumbervalidatortest","phonenumbervalidator::validator::new()","phonenumbervalidatortest#test_invalid_phone_number()","phonenumbervalidatortest#test_no_phone_number()","phonenumbervalidatortest#test_valid_phone_number()","phonenumbervalidator::validate()","phonenumbervalidator::validator#validate()",""],"info":[["PhoneNumberValidator","","PhoneNumberValidator.html","","<p>This class is the master/parent class to all of the validation\nfunctionality\n"],["PhoneNumberValidator::Validator","","PhoneNumberValidator/Validator.html","","<p>This class does all of the matching and checking work for the validation of\nthe phone number.\n"],["PhoneNumberValidatorTest","","PhoneNumberValidatorTest.html","","<p>This class respresents the testing-unit for this gem app\n<p><strong>Inherits from:</strong>\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Test</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Unit</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">TestCase</span>\n</pre>\n"],["new","PhoneNumberValidator::Validator","PhoneNumberValidator/Validator.html#method-c-new","(phone_number = '+1 (949) 355-6244 ext. 198842')","<p>
|
1
|
+
var search_data = {"index":{"searchIndex":["phonenumbervalidator","validator","phonenumbervalidatortest","new()","test_invalid_phone_number()","test_no_phone_number()","test_valid_phone_number()","validate()","validate()","readme"],"longSearchIndex":["phonenumbervalidator","phonenumbervalidator::validator","phonenumbervalidatortest","phonenumbervalidator::validator::new()","phonenumbervalidatortest#test_invalid_phone_number()","phonenumbervalidatortest#test_no_phone_number()","phonenumbervalidatortest#test_valid_phone_number()","phonenumbervalidator::validate()","phonenumbervalidator::validator#validate()",""],"info":[["PhoneNumberValidator","","PhoneNumberValidator.html","","<p>This class is the master/parent class to all of the validation\nfunctionality\n"],["PhoneNumberValidator::Validator","","PhoneNumberValidator/Validator.html","","<p>This class does all of the matching and checking work for the validation of\nthe phone number.\n"],["PhoneNumberValidatorTest","","PhoneNumberValidatorTest.html","","<p>This class respresents the testing-unit for this gem app\n<p><strong>Inherits from:</strong>\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Test</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Unit</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">TestCase</span>\n</pre>\n"],["new","PhoneNumberValidator::Validator","PhoneNumberValidator/Validator.html#method-c-new","(phone_number = '+1 (949) 355-6244 ext. 198842')","<p>Initializes the <strong>@phone_number</strong> instance variable\n"],["test_invalid_phone_number","PhoneNumberValidatorTest","PhoneNumberValidatorTest.html#method-i-test_invalid_phone_number","()","<p>This test inputs an invalid phone number and expects the output to be\n<strong>false</strong>\n"],["test_no_phone_number","PhoneNumberValidatorTest","PhoneNumberValidatorTest.html#method-i-test_no_phone_number","()","<p>This test inputs no phone number and expectst the output to be\n<strong>:nil</strong>\n"],["test_valid_phone_number","PhoneNumberValidatorTest","PhoneNumberValidatorTest.html#method-i-test_valid_phone_number","()","<p>This test inputs a valid phone number and expects the output to be\n<strong>true</strong>\n"],["validate","PhoneNumberValidator","PhoneNumberValidator.html#method-c-validate","(phone_number)","<p>Validates any United States phone number!\n<p><strong>Arguments:</strong>\n\n<pre>phone_number: (String)</pre>\n"],["validate","PhoneNumberValidator::Validator","PhoneNumberValidator/Validator.html#method-i-validate","()","<p>Checks to see if the phone number the user entered is valid by testing\nregex the pattern with the phone …\n"],["README","","README_rdoc.html","","<p>Phone Number Validator\n<p>About\n<p>This app is a US phone number-validating RubyGem.\n"]]}}
|
data/doc/js/search_index.js.gz
CHANGED
Binary file
|
@@ -11,7 +11,7 @@ class PhoneNumberValidator::Validator
|
|
11
11
|
PHONE_NUMBER_REGEX = Regexp.new('^(?:(?:[2-9]11)|(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:\x20+|#|x\.?|ext\.?|extension)\s*(\d+))?)$', Regexp::IGNORECASE)
|
12
12
|
|
13
13
|
##
|
14
|
-
#
|
14
|
+
# Initializes the <b>@phone_number</b> instance variable
|
15
15
|
def initialize(phone_number = '+1 (949) 355-6244 ext. 198842')
|
16
16
|
@phone_number = phone_number
|
17
17
|
end
|
@@ -20,8 +20,7 @@ class PhoneNumberValidator::Validator
|
|
20
20
|
# Checks to see if the phone number the user entered is valid
|
21
21
|
# by testing regex the pattern with the phone number
|
22
22
|
#
|
23
|
-
# <b>Return Type:</b>
|
24
|
-
# boolean or symbol
|
23
|
+
# <b>Return Type:</b> boolean or symbol
|
25
24
|
def validate
|
26
25
|
if (@phone_number.match(PHONE_NUMBER_REGEX))
|
27
26
|
return true
|