phone_number_validator 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +26 -26
- data/Gemfile +6 -6
- data/LICENSE +21 -21
- data/README.rdoc +66 -66
- data/Rakefile +26 -26
- data/bin/pnv +18 -18
- data/doc/PhoneNumberValidator.html +161 -161
- data/doc/PhoneNumberValidator/Validator.html +228 -225
- data/doc/PhoneNumberValidatorTest.html +236 -234
- data/doc/README_rdoc.html +171 -171
- data/doc/created.rid +6 -6
- data/doc/css/fonts.css +6 -6
- data/doc/index.html +164 -165
- data/doc/js/darkfish.js +7 -7
- data/doc/js/navigation.js +4 -3
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +0 -1
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +104 -134
- data/lib/phone_number_validator.rb +18 -18
- data/lib/phone_number_validator/validator.rb +33 -33
- data/phone_number_validator.gemspec +36 -34
- data/test/test_phone_number_validator.rb +31 -31
- metadata +43 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ec0f6682110705b7bbb4a74b76084d79220cc6f3
|
4
|
+
data.tar.gz: b26d85196e15e9b6abbf4f1491dd817e5630956e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf727fc8a574b7cfe8a901e7df8b6be37074721da19570a295b509be91701fb1f1f5f59ebc2527b0f29f4da71aa05004f5350e4c83ea8d2dc11c2278eaef4c74
|
7
|
+
data.tar.gz: 43f8e32543b9bd4a98d15934f54f7163446bcd4e3a490abfc61014149b192097c7b2082c595a9d044684ab01b1a5f977114d5af43718306e8e96773555c74e0d
|
data/.gitignore
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
# System File(s)/Folder(s)
|
2
|
-
.DS_Store
|
3
|
-
Thumbs.db
|
4
|
-
_MACOSX
|
5
|
-
|
6
|
-
# Editor File(s)/Folder(s)
|
7
|
-
*.code-workspace
|
8
|
-
*.sublime-project
|
9
|
-
*.sublime-workspace
|
10
|
-
.vscode
|
11
|
-
.idea
|
12
|
-
|
13
|
-
# Generated Files
|
14
|
-
*.gem
|
15
|
-
*.lock
|
16
|
-
|
17
|
-
# Executables
|
18
|
-
*.bat
|
19
|
-
*.sh
|
20
|
-
|
21
|
-
# if gitignore is not working, try this:
|
22
|
-
#
|
23
|
-
# git rm -r --cached .
|
24
|
-
# git add .
|
25
|
-
# git commit -m "fixed untracked files"
|
26
|
-
# git push
|
1
|
+
# System File(s)/Folder(s)
|
2
|
+
.DS_Store
|
3
|
+
Thumbs.db
|
4
|
+
_MACOSX
|
5
|
+
|
6
|
+
# Editor File(s)/Folder(s)
|
7
|
+
*.code-workspace
|
8
|
+
*.sublime-project
|
9
|
+
*.sublime-workspace
|
10
|
+
.vscode
|
11
|
+
.idea
|
12
|
+
|
13
|
+
# Generated Files
|
14
|
+
*.gem
|
15
|
+
*.lock
|
16
|
+
|
17
|
+
# Executables
|
18
|
+
*.bat
|
19
|
+
*.sh
|
20
|
+
|
21
|
+
# if gitignore is not working, try this:
|
22
|
+
#
|
23
|
+
# git rm -r --cached .
|
24
|
+
# git add .
|
25
|
+
# git commit -m "fixed untracked files"
|
26
|
+
# git push
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
platform :ruby do
|
3
|
-
gemspec
|
4
|
-
gem 'rdoc', '~> 6.0', '>= 6.0.4'
|
5
|
-
gem 'rake', '~> 11.2', '>= 11.2.2'
|
6
|
-
end
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
platform :ruby do
|
3
|
+
gemspec
|
4
|
+
gem 'rdoc', '~> 6.0', '>= 6.0.4'
|
5
|
+
gem 'rake', '~> 11.2', '>= 11.2.2'
|
6
|
+
end
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2018 bag33188
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 bag33188
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.rdoc
CHANGED
@@ -1,66 +1,66 @@
|
|
1
|
-
= Phone Number Validator
|
2
|
-
|
3
|
-
== About
|
4
|
-
|
5
|
-
This app is a US phone number-validating RubyGem.
|
6
|
-
|
7
|
-
It uses a complex regular expression to validate any United States phone number.
|
8
|
-
|
9
|
-
=== Regular Expression
|
10
|
-
|
11
|
-
This gem uses the following regular expression:
|
12
|
-
|
13
|
-
# US Phone Numbers
|
14
|
-
/^(?:(?:[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+))?)$/i
|
15
|
-
# Regex Flags: i (ignore case)
|
16
|
-
|
17
|
-
== Installing
|
18
|
-
|
19
|
-
$ gem install phone_number_validator
|
20
|
-
|
21
|
-
=== Install Required Gems/Dependencies
|
22
|
-
|
23
|
-
$ bundle install
|
24
|
-
|
25
|
-
=== Updating Required Gems/Dependencies
|
26
|
-
|
27
|
-
$ bundle update
|
28
|
-
|
29
|
-
== Uninstalling
|
30
|
-
|
31
|
-
$ gem uninstall phone_number_validator
|
32
|
-
|
33
|
-
== Testing
|
34
|
-
|
35
|
-
$ rake test
|
36
|
-
|
37
|
-
== Usage
|
38
|
-
|
39
|
-
=== In command line
|
40
|
-
|
41
|
-
$ pnv "+1 (987) 654-3210 ext. 198842"
|
42
|
-
|
43
|
-
==== Output
|
44
|
-
|
45
|
-
=> true
|
46
|
-
|
47
|
-
=== In Ruby code
|
48
|
-
|
49
|
-
require 'phone_number_validator'
|
50
|
-
|
51
|
-
check_phone_number = PhoneNumberValidator.validate_phone_number('+1 (987) 654-3210 ext. 198842')
|
52
|
-
|
53
|
-
print check_phone_number
|
54
|
-
|
55
|
-
==== Output
|
56
|
-
|
57
|
-
=> true
|
58
|
-
|
59
|
-
Output can be <b>true</b> (<em>boolean, valid phone number</em>), <b>false</b> (<em>boolean, invalid phone number</em>), or <b>nil</b> (<em>symbol, no phone number entered</em>).
|
60
|
-
|
61
|
-
== Development
|
62
|
-
|
63
|
-
Run the following to make +bin/pnv+ executable (Unix only):
|
64
|
-
|
65
|
-
chmod ugo+x bin/pnv
|
66
|
-
|
1
|
+
= Phone Number Validator
|
2
|
+
|
3
|
+
== About
|
4
|
+
|
5
|
+
This app is a US phone number-validating RubyGem.
|
6
|
+
|
7
|
+
It uses a complex regular expression to validate any United States phone number.
|
8
|
+
|
9
|
+
=== Regular Expression
|
10
|
+
|
11
|
+
This gem uses the following regular expression:
|
12
|
+
|
13
|
+
# US Phone Numbers
|
14
|
+
/^(?:(?:[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+))?)$/i
|
15
|
+
# Regex Flags: i (ignore case)
|
16
|
+
|
17
|
+
== Installing
|
18
|
+
|
19
|
+
$ gem install phone_number_validator
|
20
|
+
|
21
|
+
=== Install Required Gems/Dependencies
|
22
|
+
|
23
|
+
$ bundle install
|
24
|
+
|
25
|
+
=== Updating Required Gems/Dependencies
|
26
|
+
|
27
|
+
$ bundle update
|
28
|
+
|
29
|
+
== Uninstalling
|
30
|
+
|
31
|
+
$ gem uninstall phone_number_validator
|
32
|
+
|
33
|
+
== Testing
|
34
|
+
|
35
|
+
$ rake test
|
36
|
+
|
37
|
+
== Usage
|
38
|
+
|
39
|
+
=== In command line
|
40
|
+
|
41
|
+
$ pnv "+1 (987) 654-3210 ext. 198842"
|
42
|
+
|
43
|
+
==== Output
|
44
|
+
|
45
|
+
=> true
|
46
|
+
|
47
|
+
=== In Ruby code
|
48
|
+
|
49
|
+
require 'phone_number_validator'
|
50
|
+
|
51
|
+
check_phone_number = PhoneNumberValidator.validate_phone_number('+1 (987) 654-3210 ext. 198842')
|
52
|
+
|
53
|
+
print check_phone_number
|
54
|
+
|
55
|
+
==== Output
|
56
|
+
|
57
|
+
=> true
|
58
|
+
|
59
|
+
Output can be <b>true</b> (<em>boolean, valid phone number</em>), <b>false</b> (<em>boolean, invalid phone number</em>), or <b>nil</b> (<em>symbol, no phone number entered</em>).
|
60
|
+
|
61
|
+
== Development
|
62
|
+
|
63
|
+
Run the following to make +bin/pnv+ executable (Unix only):
|
64
|
+
|
65
|
+
chmod ugo+x bin/pnv
|
66
|
+
|
data/Rakefile
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
require 'rake/testtask'
|
2
|
-
require 'rdoc/task'
|
3
|
-
|
4
|
-
Rake::TestTask.new do |test|
|
5
|
-
test.libs << 'test'
|
6
|
-
end
|
7
|
-
|
8
|
-
desc 'Run tests'
|
9
|
-
task :default => :test
|
10
|
-
|
11
|
-
RDoc::Task.new do |rdoc|
|
12
|
-
rdoc.main = 'README.rdoc'
|
13
|
-
rdoc.title = 'Phone Number Validator'
|
14
|
-
rdoc.rdoc_dir = 'doc'
|
15
|
-
rdoc.rdoc_files.include('README.rdoc', 'lib/*.rb', 'lib/**/*.rb', 'test/*.rb', 'bin/*')
|
16
|
-
end
|
17
|
-
|
18
|
-
# for Windows
|
19
|
-
task :deldocw do
|
20
|
-
`RMDIR /S /Q "doc"`
|
21
|
-
end
|
22
|
-
|
23
|
-
# for Unix
|
24
|
-
task :deldocx do
|
25
|
-
`rm -rf doc`
|
26
|
-
end
|
1
|
+
require 'rake/testtask'
|
2
|
+
require 'rdoc/task'
|
3
|
+
|
4
|
+
Rake::TestTask.new do |test|
|
5
|
+
test.libs << 'test'
|
6
|
+
end
|
7
|
+
|
8
|
+
desc 'Run tests'
|
9
|
+
task :default => :test
|
10
|
+
|
11
|
+
RDoc::Task.new do |rdoc|
|
12
|
+
rdoc.main = 'README.rdoc'
|
13
|
+
rdoc.title = 'Phone Number Validator'
|
14
|
+
rdoc.rdoc_dir = 'doc'
|
15
|
+
rdoc.rdoc_files.include('README.rdoc', 'lib/*.rb', 'lib/**/*.rb', 'test/*.rb', 'bin/*')
|
16
|
+
end
|
17
|
+
|
18
|
+
# for Windows
|
19
|
+
task :deldocw do
|
20
|
+
`RMDIR /S /Q "doc"`
|
21
|
+
end
|
22
|
+
|
23
|
+
# for Unix
|
24
|
+
task :deldocx do
|
25
|
+
`rm -rf doc`
|
26
|
+
end
|
data/bin/pnv
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
=begin
|
4
|
-
|======================|
|
5
|
-
| PhoneNumberValidator |
|
6
|
-
|----------------------|
|
7
|
-
| Made by: bag33188 |
|
8
|
-
|======================|
|
9
|
-
=end
|
10
|
-
|
11
|
-
require 'phone_number_validator'
|
12
|
-
|
13
|
-
if (ARGV[0] == nil)
|
14
|
-
print "No phone number entered.\r\n"
|
15
|
-
else
|
16
|
-
# execute validator
|
17
|
-
puts PhoneNumberValidator.validate(ARGV[0])
|
18
|
-
end
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|======================|
|
5
|
+
| PhoneNumberValidator |
|
6
|
+
|----------------------|
|
7
|
+
| Made by: bag33188 |
|
8
|
+
|======================|
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'phone_number_validator'
|
12
|
+
|
13
|
+
if (ARGV[0] == nil)
|
14
|
+
print "No phone number entered.\r\n"
|
15
|
+
else
|
16
|
+
# execute validator
|
17
|
+
puts PhoneNumberValidator.validate(ARGV[0])
|
18
|
+
end
|
@@ -1,161 +1,161 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class PhoneNumberValidator - Phone Number Validator</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "./";
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<script src="./js/
|
15
|
-
|
16
|
-
|
17
|
-
<link href="./css/
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<
|
24
|
-
<
|
25
|
-
<
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
<a href="./table_of_contents.html#
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<div id="search-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
</div>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
<
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
</div>
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<span class="ruby-
|
136
|
-
|
137
|
-
<span class="ruby-identifier">validator</span>.<span class="ruby-identifier">
|
138
|
-
<span class="ruby-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
</main>
|
154
|
-
|
155
|
-
|
156
|
-
<footer id="validator-badges" role="contentinfo">
|
157
|
-
<p><a href="
|
158
|
-
<p>Generated by <a href="
|
159
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
160
|
-
</footer>
|
161
|
-
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class PhoneNumberValidator - Phone Number Validator</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script src="./js/jquery.js"></script>
|
14
|
+
<script src="./js/darkfish.js"></script>
|
15
|
+
|
16
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
17
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<body id="top" role="document" class="class">
|
22
|
+
<nav role="navigation">
|
23
|
+
<div id="project-navigation">
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
25
|
+
<h2>
|
26
|
+
<a href="./index.html" rel="home">Home</a>
|
27
|
+
</h2>
|
28
|
+
|
29
|
+
<div id="table-of-contents-navigation">
|
30
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
31
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
32
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
38
|
+
<div id="search-field-wrapper">
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
46
|
+
aria-busy="false" aria-expanded="false"
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
48
|
+
</form>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<div id="class-metadata">
|
56
|
+
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
58
|
+
<h3>Parent</h3>
|
59
|
+
|
60
|
+
|
61
|
+
<p class="link">Object
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<div id="method-list-section" class="nav-section">
|
69
|
+
<h3>Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list" role="directory">
|
72
|
+
|
73
|
+
<li ><a href="#method-c-validate">::validate</a>
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
<main role="main" aria-labelledby="class-PhoneNumberValidator">
|
82
|
+
<h1 id="class-PhoneNumberValidator" class="class">
|
83
|
+
class PhoneNumberValidator
|
84
|
+
</h1>
|
85
|
+
|
86
|
+
<section class="description">
|
87
|
+
|
88
|
+
<p>This class is the master/parent class to all of the validation
|
89
|
+
functionality</p>
|
90
|
+
|
91
|
+
</section>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
107
|
+
<header>
|
108
|
+
<h3>Public Class Methods</h3>
|
109
|
+
</header>
|
110
|
+
|
111
|
+
|
112
|
+
<div id="method-c-validate" class="method-detail ">
|
113
|
+
|
114
|
+
<div class="method-heading">
|
115
|
+
<span class="method-name">validate</span><span
|
116
|
+
class="method-args">(phone_number)</span>
|
117
|
+
|
118
|
+
<span class="method-click-advice">click to toggle source</span>
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
<div class="method-description">
|
124
|
+
|
125
|
+
<p>Validates any United States phone number!</p>
|
126
|
+
|
127
|
+
<p><strong>Arguments:</strong></p>
|
128
|
+
|
129
|
+
<pre>phone_number: (String)</pre>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<div class="method-source-code" id="validate-source">
|
135
|
+
<pre><span class="ruby-comment"># File lib/phone_number_validator.rb, line 11</span>
|
136
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">validate</span>(<span class="ruby-identifier">phone_number</span>)
|
137
|
+
<span class="ruby-identifier">validator</span> = <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">phone_number</span>)
|
138
|
+
<span class="ruby-identifier">validator</span>.<span class="ruby-identifier">validate</span>
|
139
|
+
<span class="ruby-keyword">end</span></pre>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
</div>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
|
150
|
+
</section>
|
151
|
+
|
152
|
+
</section>
|
153
|
+
</main>
|
154
|
+
|
155
|
+
|
156
|
+
<footer id="validator-badges" role="contentinfo">
|
157
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
158
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
|
159
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
160
|
+
</footer>
|
161
|
+
|