phone_number_validator 0.7.4 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,230 +1,230 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="UTF-8">
6
-
7
- <title>class PhoneNumberValidator::Validator - 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
- <body id="top" role="document" class="class">
23
- <nav role="navigation">
24
- <div id="project-navigation">
25
- <div id="home-section" role="region" title="Quick navigation" class="nav-section">
26
- <h2>
27
- <a href="../index.html" rel="home">Home</a>
28
- </h2>
29
-
30
- <div id="table-of-contents-navigation">
31
- <a href="../table_of_contents.html#pages">Pages</a>
32
- <a href="../table_of_contents.html#classes">Classes</a>
33
- <a href="../table_of_contents.html#methods">Methods</a>
34
- </div>
35
- </div>
36
-
37
- <div id="search-section" role="search" class="project-section initially-hidden">
38
- <form action="#" method="get" accept-charset="utf-8">
39
- <div id="search-field-wrapper">
40
- <input id="search-field" role="combobox" aria-label="Search"
41
- aria-autocomplete="list" aria-controls="search-results"
42
- type="text" name="search" placeholder="Search" spellcheck="false"
43
- title="Type to search, Up and Down to navigate, Enter to load">
44
- </div>
45
-
46
- <ul id="search-results" aria-label="Search Results"
47
- aria-busy="false" aria-expanded="false"
48
- aria-atomic="false" class="initially-hidden"></ul>
49
- </form>
50
- </div>
51
-
52
- </div>
53
-
54
-
55
-
56
- <div id="class-metadata">
57
-
58
- <div id="parent-class-section" class="nav-section">
59
- <h3>Parent</h3>
60
-
61
-
62
- <p class="link">Object
63
-
64
- </div>
65
-
66
-
67
-
68
- <!-- Method Quickref -->
69
- <div id="method-list-section" class="nav-section">
70
- <h3>Methods</h3>
71
-
72
- <ul class="link-list" role="directory">
73
-
74
- <li ><a href="#method-c-new">::new</a>
75
-
76
- <li ><a href="#method-i-validate">#validate</a>
77
-
78
- </ul>
79
- </div>
80
-
81
- </div>
82
- </nav>
83
-
84
- <main role="main" aria-labelledby="class-PhoneNumberValidator::Validator">
85
- <h1 id="class-PhoneNumberValidator::Validator" class="class">
86
- class PhoneNumberValidator::Validator
87
- </h1>
88
-
89
- <section class="description">
90
-
91
- <p>This class does all of the matching and checking work for the validation of
92
- the phone number.</p>
93
-
94
- </section>
95
-
96
-
97
- <section id="5Buntitled-5D" class="documentation-section">
98
-
99
-
100
-
101
-
102
-
103
- <section class="constants-list">
104
- <header>
105
- <h3>Constants</h3>
106
- </header>
107
- <dl>
108
-
109
- <dt id="PHONE_NUMBER_REGEX">PHONE_NUMBER_REGEX
110
-
111
- <dd><p>The regex pattern for validating US phone numbers</p>
112
-
113
- <p>Regular Expression tested using <a
114
- href="https://regexr.com/">regexr.com</a></p>
115
-
116
- <p>The regular expression used can be found in <em>README.rdoc</em> on the
117
- documentation&#39;s home page</p>
118
-
119
-
120
- </dl>
121
- </section>
122
-
123
-
124
-
125
-
126
-
127
- <section id="public-class-5Buntitled-5D-method-details" class="method-section">
128
- <header>
129
- <h3>Public Class Methods</h3>
130
- </header>
131
-
132
-
133
- <div id="method-c-new" class="method-detail ">
134
-
135
- <div class="method-heading">
136
- <span class="method-name">new</span><span
137
- class="method-args">(phone_number = &#39;+1 (949) 355-6244 ext. 198842&#39;)</span>
138
-
139
- <span class="method-click-advice">click to toggle source</span>
140
-
141
- </div>
142
-
143
-
144
- <div class="method-description">
145
-
146
- <p>initializes the <strong>@phone_number</strong> instance variable</p>
147
-
148
-
149
-
150
-
151
- <div class="method-source-code" id="new-source">
152
- <pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line 15</span>
153
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">phone_number</span> = <span class="ruby-string">&#39;+1 (949) 355-6244 ext. 198842&#39;</span>)
154
- <span class="ruby-ivar">@phone_number</span> = <span class="ruby-identifier">phone_number</span>
155
- <span class="ruby-keyword">end</span></pre>
156
- </div>
157
-
158
- </div>
159
-
160
-
161
-
162
-
163
- </div>
164
-
165
-
166
- </section>
167
-
168
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
169
- <header>
170
- <h3>Public Instance Methods</h3>
171
- </header>
172
-
173
-
174
- <div id="method-i-validate" class="method-detail ">
175
-
176
- <div class="method-heading">
177
- <span class="method-name">validate</span><span
178
- class="method-args">()</span>
179
-
180
- <span class="method-click-advice">click to toggle source</span>
181
-
182
- </div>
183
-
184
-
185
- <div class="method-description">
186
-
187
- <p>Checks to see if the phone number the user entered is valid by testing
188
- regex the pattern with the phone number</p>
189
-
190
- <p><strong>Return Type:</strong></p>
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>
194
-
195
-
196
-
197
-
198
- <div class="method-source-code" id="validate-source">
199
- <pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line 25</span>
200
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate</span>
201
- <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
- <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
203
- <span class="ruby-keyword">elsif</span> (<span class="ruby-ivar">@phone_number</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;&#39;</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@phone_number</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>)
204
- <span class="ruby-keyword">return</span> <span class="ruby-value">:nil</span>
205
- <span class="ruby-keyword">else</span>
206
- <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span>
207
- <span class="ruby-keyword">end</span>
208
- <span class="ruby-keyword">end</span></pre>
209
- </div>
210
-
211
- </div>
212
-
213
-
214
-
215
-
216
- </div>
217
-
218
-
219
- </section>
220
-
221
- </section>
222
- </main>
223
-
224
-
225
- <footer id="validator-badges" role="contentinfo">
226
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
227
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.1.
228
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
229
- </footer>
230
-
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class PhoneNumberValidator::Validator - 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
+ <body id="top" role="document" class="class">
23
+ <nav role="navigation">
24
+ <div id="project-navigation">
25
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
26
+ <h2>
27
+ <a href="../index.html" rel="home">Home</a>
28
+ </h2>
29
+
30
+ <div id="table-of-contents-navigation">
31
+ <a href="../table_of_contents.html#pages">Pages</a>
32
+ <a href="../table_of_contents.html#classes">Classes</a>
33
+ <a href="../table_of_contents.html#methods">Methods</a>
34
+ </div>
35
+ </div>
36
+
37
+ <div id="search-section" role="search" class="project-section initially-hidden">
38
+ <form action="#" method="get" accept-charset="utf-8">
39
+ <div id="search-field-wrapper">
40
+ <input id="search-field" role="combobox" aria-label="Search"
41
+ aria-autocomplete="list" aria-controls="search-results"
42
+ type="text" name="search" placeholder="Search" spellcheck="false"
43
+ title="Type to search, Up and Down to navigate, Enter to load">
44
+ </div>
45
+
46
+ <ul id="search-results" aria-label="Search Results"
47
+ aria-busy="false" aria-expanded="false"
48
+ aria-atomic="false" class="initially-hidden"></ul>
49
+ </form>
50
+ </div>
51
+
52
+ </div>
53
+
54
+
55
+
56
+ <div id="class-metadata">
57
+
58
+ <div id="parent-class-section" class="nav-section">
59
+ <h3>Parent</h3>
60
+
61
+
62
+ <p class="link">Object
63
+
64
+ </div>
65
+
66
+
67
+
68
+ <!-- Method Quickref -->
69
+ <div id="method-list-section" class="nav-section">
70
+ <h3>Methods</h3>
71
+
72
+ <ul class="link-list" role="directory">
73
+
74
+ <li ><a href="#method-c-new">::new</a>
75
+
76
+ <li ><a href="#method-i-validate">#validate</a>
77
+
78
+ </ul>
79
+ </div>
80
+
81
+ </div>
82
+ </nav>
83
+
84
+ <main role="main" aria-labelledby="class-PhoneNumberValidator::Validator">
85
+ <h1 id="class-PhoneNumberValidator::Validator" class="class">
86
+ class PhoneNumberValidator::Validator
87
+ </h1>
88
+
89
+ <section class="description">
90
+
91
+ <p>This class does all of the matching and checking work for the validation of
92
+ the phone number.</p>
93
+
94
+ </section>
95
+
96
+
97
+ <section id="5Buntitled-5D" class="documentation-section">
98
+
99
+
100
+
101
+
102
+
103
+ <section class="constants-list">
104
+ <header>
105
+ <h3>Constants</h3>
106
+ </header>
107
+ <dl>
108
+
109
+ <dt id="PHONE_NUMBER_REGEX">PHONE_NUMBER_REGEX
110
+
111
+ <dd><p>The regex pattern for validating US phone numbers</p>
112
+
113
+ <p>Regular Expression tested using <a
114
+ href="https://regexr.com/">regexr.com</a></p>
115
+
116
+ <p>The regular expression used can be found in <em>README.rdoc</em> on the
117
+ documentation&#39;s home page</p>
118
+
119
+
120
+ </dl>
121
+ </section>
122
+
123
+
124
+
125
+
126
+
127
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
128
+ <header>
129
+ <h3>Public Class Methods</h3>
130
+ </header>
131
+
132
+
133
+ <div id="method-c-new" class="method-detail ">
134
+
135
+ <div class="method-heading">
136
+ <span class="method-name">new</span><span
137
+ class="method-args">(phone_number = &#39;+1 (949) 355-6244 ext. 198842&#39;)</span>
138
+
139
+ <span class="method-click-advice">click to toggle source</span>
140
+
141
+ </div>
142
+
143
+
144
+ <div class="method-description">
145
+
146
+ <p>initializes the <strong>@phone_number</strong> instance variable</p>
147
+
148
+
149
+
150
+
151
+ <div class="method-source-code" id="new-source">
152
+ <pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line 15</span>
153
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">phone_number</span> = <span class="ruby-string">&#39;+1 (949) 355-6244 ext. 198842&#39;</span>)
154
+ <span class="ruby-ivar">@phone_number</span> = <span class="ruby-identifier">phone_number</span>
155
+ <span class="ruby-keyword">end</span></pre>
156
+ </div>
157
+
158
+ </div>
159
+
160
+
161
+
162
+
163
+ </div>
164
+
165
+
166
+ </section>
167
+
168
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
169
+ <header>
170
+ <h3>Public Instance Methods</h3>
171
+ </header>
172
+
173
+
174
+ <div id="method-i-validate" class="method-detail ">
175
+
176
+ <div class="method-heading">
177
+ <span class="method-name">validate</span><span
178
+ class="method-args">()</span>
179
+
180
+ <span class="method-click-advice">click to toggle source</span>
181
+
182
+ </div>
183
+
184
+
185
+ <div class="method-description">
186
+
187
+ <p>Checks to see if the phone number the user entered is valid by testing
188
+ regex the pattern with the phone number</p>
189
+
190
+ <p><strong>Return Type:</strong></p>
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>
194
+
195
+
196
+
197
+
198
+ <div class="method-source-code" id="validate-source">
199
+ <pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line 25</span>
200
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate</span>
201
+ <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
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
203
+ <span class="ruby-keyword">elsif</span> (<span class="ruby-ivar">@phone_number</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;&#39;</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@phone_number</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>)
204
+ <span class="ruby-keyword">return</span> <span class="ruby-value">:nil</span>
205
+ <span class="ruby-keyword">else</span>
206
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span>
207
+ <span class="ruby-keyword">end</span>
208
+ <span class="ruby-keyword">end</span></pre>
209
+ </div>
210
+
211
+ </div>
212
+
213
+
214
+
215
+
216
+ </div>
217
+
218
+
219
+ </section>
220
+
221
+ </section>
222
+ </main>
223
+
224
+
225
+ <footer id="validator-badges" role="contentinfo">
226
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
227
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.4.
228
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
229
+ </footer>
230
+