phone_number_validator 0.9.4 → 0.9.5
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 +5 -5
- data/.gitignore +26 -26
- data/Gemfile +6 -6
- data/LICENSE +21 -21
- data/README.rdoc +72 -72
- data/Rakefile +26 -26
- data/bin/pnv +18 -18
- data/doc/PhoneNumberValidator.html +161 -161
- data/doc/PhoneNumberValidator/Validator.html +225 -228
- data/doc/PhoneNumberValidatorTest.html +234 -236
- data/doc/README_rdoc.html +183 -179
- data/doc/created.rid +6 -6
- data/doc/css/fonts.css +6 -6
- data/doc/index.html +176 -172
- data/doc/js/darkfish.js +7 -7
- data/doc/js/navigation.js +3 -4
- 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 +1 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +136 -104
- data/lib/phone_number_validator.rb +18 -18
- data/lib/phone_number_validator/validator.rb +33 -33
- data/phone_number_validator.gemspec +34 -36
- data/test/test_phone_number_validator.rb +31 -31
- metadata +3 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 59032171c3240b10d99fecc68c26831e7a85860094eb332059cfe84ffa6fca92
|
4
|
+
data.tar.gz: aef7c9e25c076985cecd3a64f6dcd8e1fa3cc2edf508c635f3b50bdfe4478c91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0afad9ff540b43781b7f4350d5ab6dfef76c5811dafb82ab25d714926990c1b92e0189a419faf002c9c6c04c12b2ce35260aded9684aee8a1967b35cd982c988
|
7
|
+
data.tar.gz: 53aca592ac1146ad9eb8bf47c8f3708ea59cfe2df9f61ad10bfbec4dfbb912bb6ac9c26908ca2fdbfc96ff22d8c7c8e72d87acccbd363b90d68bae2405b5f4ca
|
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,72 +1,72 @@
|
|
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 Types
|
60
|
-
|
61
|
-
Output can be:
|
62
|
-
* <b>true</b> (<em>boolean: valid phone number</em>)
|
63
|
-
* <b>false</b> (<em>boolean: invalid phone number</em>)
|
64
|
-
* <b>nil</b> (<em>nil: no phone number entered</em>)
|
65
|
-
* <b>void</b> (<em>void: no phone number arg provided</em>)
|
66
|
-
|
67
|
-
== Development
|
68
|
-
|
69
|
-
Run the following in development to make +bin/pnv+ executable (Unix only):
|
70
|
-
|
71
|
-
chmod ugo+x bin/pnv
|
72
|
-
|
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 Types
|
60
|
+
|
61
|
+
Output can be:
|
62
|
+
* <b>true</b> (<em>boolean: valid phone number</em>)
|
63
|
+
* <b>false</b> (<em>boolean: invalid phone number</em>)
|
64
|
+
* <b>nil</b> (<em>nil: no phone number entered</em>)
|
65
|
+
* <b>void</b> (<em>void: no phone number arg provided</em>)
|
66
|
+
|
67
|
+
== Development
|
68
|
+
|
69
|
+
Run the following in development to make +bin/pnv+ executable (Unix only):
|
70
|
+
|
71
|
+
chmod ugo+x bin/pnv
|
72
|
+
|
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
|
-
|
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
|
-
|
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
|
-
|
136
|
-
<span class="ruby-
|
137
|
-
<span class="ruby-identifier">validator</span
|
138
|
-
|
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
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="class">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<div id="parent-class-section" class="nav-section">
|
60
|
+
<h3>Parent</h3>
|
61
|
+
|
62
|
+
|
63
|
+
<p class="link">Object
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<!-- Method Quickref -->
|
70
|
+
<div id="method-list-section" class="nav-section">
|
71
|
+
<h3>Methods</h3>
|
72
|
+
|
73
|
+
<ul class="link-list" role="directory">
|
74
|
+
|
75
|
+
<li ><a href="#method-c-validate">::validate</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-labelledby="class-PhoneNumberValidator">
|
84
|
+
<h1 id="class-PhoneNumberValidator" class="class">
|
85
|
+
class PhoneNumberValidator
|
86
|
+
</h1>
|
87
|
+
|
88
|
+
<section class="description">
|
89
|
+
|
90
|
+
<p>This class is the master/parent class to all of the validation functionality</p>
|
91
|
+
|
92
|
+
</section>
|
93
|
+
|
94
|
+
|
95
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
106
|
+
<header>
|
107
|
+
<h3>Public Class Methods</h3>
|
108
|
+
</header>
|
109
|
+
|
110
|
+
|
111
|
+
<div id="method-c-validate" class="method-detail ">
|
112
|
+
|
113
|
+
<div class="method-heading">
|
114
|
+
<span class="method-name">validate</span><span
|
115
|
+
class="method-args">(phone_number)</span>
|
116
|
+
|
117
|
+
<span class="method-click-advice">click to toggle source</span>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
<div class="method-description">
|
123
|
+
|
124
|
+
<p>Validates any United States phone number!</p>
|
125
|
+
|
126
|
+
<p><strong>Arguments:</strong></p>
|
127
|
+
|
128
|
+
<pre>phone_number: (String)</pre>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<div class="method-source-code" id="validate-source">
|
134
|
+
<pre><span class="ruby-comment"># File lib/phone_number_validator.rb, line 11</span>
|
135
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate</span>(<span class="ruby-identifier">phone_number</span>)
|
136
|
+
<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>)
|
137
|
+
<span class="ruby-identifier">validator</span>.<span class="ruby-identifier">validate</span>
|
138
|
+
<span class="ruby-keyword">end</span></pre>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</div>
|
147
|
+
|
148
|
+
|
149
|
+
</section>
|
150
|
+
|
151
|
+
</section>
|
152
|
+
|
153
|
+
</main>
|
154
|
+
|
155
|
+
|
156
|
+
<footer id="validator-badges" role="contentinfo">
|
157
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
158
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.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
|
+
|