phone_number_validator 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,227 +1,225 @@
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 (987) 654-3210 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 (987) 654-3210 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> boolean or symbol</p>
191
-
192
-
193
-
194
-
195
- <div class="method-source-code" id="validate-source">
196
- <pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line 24</span>
197
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate</span>
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>))
199
- <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
200
- <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>)
201
- <span class="ruby-keyword">return</span> <span class="ruby-value">:nil</span>
202
- <span class="ruby-keyword">else</span>
203
- <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span>
204
- <span class="ruby-keyword">end</span>
205
- <span class="ruby-keyword">end</span></pre>
206
- </div>
207
-
208
- </div>
209
-
210
-
211
-
212
-
213
- </div>
214
-
215
-
216
- </section>
217
-
218
- </section>
219
- </main>
220
-
221
-
222
- <footer id="validator-badges" role="contentinfo">
223
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
224
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.1.
225
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
226
- </footer>
227
-
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
+
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-new">::new</a>
76
+
77
+ <li ><a href="#method-i-validate">#validate</a>
78
+
79
+ </ul>
80
+ </div>
81
+
82
+ </div>
83
+ </nav>
84
+
85
+ <main role="main" aria-labelledby="class-PhoneNumberValidator::Validator">
86
+ <h1 id="class-PhoneNumberValidator::Validator" class="class">
87
+ class PhoneNumberValidator::Validator
88
+ </h1>
89
+
90
+ <section class="description">
91
+
92
+ <p>This class does all of the matching and checking work for the validation of 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 href="https://regexr.com/">regexr.com</a></p>
114
+
115
+ <p>The regular expression used can be found in <em>README.rdoc</em> on the documentation&#39;s home page</p>
116
+
117
+
118
+ </dl>
119
+ </section>
120
+
121
+
122
+
123
+
124
+
125
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
126
+ <header>
127
+ <h3>Public Class Methods</h3>
128
+ </header>
129
+
130
+
131
+ <div id="method-c-new" class="method-detail ">
132
+
133
+ <div class="method-heading">
134
+ <span class="method-name">new</span><span
135
+ class="method-args">(phone_number = &#39;+1 (987) 654-3210 ext. 198842&#39;)</span>
136
+
137
+ <span class="method-click-advice">click to toggle source</span>
138
+
139
+ </div>
140
+
141
+
142
+ <div class="method-description">
143
+
144
+ <p>Initializes the <strong>@phone_number</strong> instance variable</p>
145
+
146
+
147
+
148
+
149
+ <div class="method-source-code" id="new-source">
150
+ <pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line 15</span>
151
+ <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 (987) 654-3210 ext. 198842&#39;</span>)
152
+ <span class="ruby-ivar">@phone_number</span> = <span class="ruby-identifier">phone_number</span>
153
+ <span class="ruby-keyword">end</span></pre>
154
+ </div>
155
+
156
+ </div>
157
+
158
+
159
+
160
+
161
+ </div>
162
+
163
+
164
+ </section>
165
+
166
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
167
+ <header>
168
+ <h3>Public Instance Methods</h3>
169
+ </header>
170
+
171
+
172
+ <div id="method-i-validate" class="method-detail ">
173
+
174
+ <div class="method-heading">
175
+ <span class="method-name">validate</span><span
176
+ class="method-args">()</span>
177
+
178
+ <span class="method-click-advice">click to toggle source</span>
179
+
180
+ </div>
181
+
182
+
183
+ <div class="method-description">
184
+
185
+ <p>Checks to see if the phone number the user entered is valid by testing regex the pattern with the phone number</p>
186
+
187
+ <p><strong>Return Type:</strong> boolean or symbol</p>
188
+
189
+
190
+
191
+
192
+ <div class="method-source-code" id="validate-source">
193
+ <pre><span class="ruby-comment"># File lib/phone_number_validator/validator.rb, line 24</span>
194
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate</span>
195
+ <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>))
196
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
197
+ <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>)
198
+ <span class="ruby-keyword">return</span> <span class="ruby-value">:nil</span>
199
+ <span class="ruby-keyword">else</span>
200
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span>
201
+ <span class="ruby-keyword">end</span>
202
+ <span class="ruby-keyword">end</span></pre>
203
+ </div>
204
+
205
+ </div>
206
+
207
+
208
+
209
+
210
+ </div>
211
+
212
+
213
+ </section>
214
+
215
+ </section>
216
+
217
+ </main>
218
+
219
+
220
+ <footer id="validator-badges" role="contentinfo">
221
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
222
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
223
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
224
+ </footer>
225
+
@@ -1,235 +1,234 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="UTF-8">
6
-
7
- <title>class PhoneNumberValidatorTest - 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">Test::Unit::TestCase
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-i-test_invalid_phone_number">#test_invalid_phone_number</a>
75
-
76
- <li ><a href="#method-i-test_no_phone_number">#test_no_phone_number</a>
77
-
78
- <li ><a href="#method-i-test_valid_phone_number">#test_valid_phone_number</a>
79
-
80
- </ul>
81
- </div>
82
-
83
- </div>
84
- </nav>
85
-
86
- <main role="main" aria-labelledby="class-PhoneNumberValidatorTest">
87
- <h1 id="class-PhoneNumberValidatorTest" class="class">
88
- class PhoneNumberValidatorTest
89
- </h1>
90
-
91
- <section class="description">
92
-
93
- <p>This class represents the testing-unit for this gem app</p>
94
-
95
- <p><strong>Inherits from:</strong></p>
96
-
97
- <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>
98
- </pre>
99
-
100
- </section>
101
-
102
-
103
- <section id="5Buntitled-5D" class="documentation-section">
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
114
- <header>
115
- <h3>Public Instance Methods</h3>
116
- </header>
117
-
118
-
119
- <div id="method-i-test_invalid_phone_number" class="method-detail ">
120
-
121
- <div class="method-heading">
122
- <span class="method-name">test_invalid_phone_number</span><span
123
- class="method-args">()</span>
124
-
125
- <span class="method-click-advice">click to toggle source</span>
126
-
127
- </div>
128
-
129
-
130
- <div class="method-description">
131
-
132
- <p>This test inputs an invalid phone number and expects the output to be
133
- <strong>false</strong></p>
134
-
135
-
136
-
137
-
138
- <div class="method-source-code" id="test_invalid_phone_number-source">
139
- <pre><span class="ruby-comment"># File test/test_phone_number_validator.rb, line 20</span>
140
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_invalid_phone_number</span>
141
- <span class="ruby-identifier">assert_equal</span> <span class="ruby-keyword">false</span>,
142
- <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-string">&#39;94643823637337&#39;</span>)
143
- <span class="ruby-keyword">end</span></pre>
144
- </div>
145
-
146
- </div>
147
-
148
-
149
-
150
-
151
- </div>
152
-
153
-
154
- <div id="method-i-test_no_phone_number" class="method-detail ">
155
-
156
- <div class="method-heading">
157
- <span class="method-name">test_no_phone_number</span><span
158
- class="method-args">()</span>
159
-
160
- <span class="method-click-advice">click to toggle source</span>
161
-
162
- </div>
163
-
164
-
165
- <div class="method-description">
166
-
167
- <p>This test inputs no phone number and expects the output to be
168
- <strong>nil</strong></p>
169
-
170
-
171
-
172
-
173
- <div class="method-source-code" id="test_no_phone_number-source">
174
- <pre><span class="ruby-comment"># File test/test_phone_number_validator.rb, line 27</span>
175
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_no_phone_number</span>
176
- <span class="ruby-identifier">assert_equal</span> <span class="ruby-value">:nil</span>,
177
- <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-string">&#39;&#39;</span>)
178
- <span class="ruby-keyword">end</span></pre>
179
- </div>
180
-
181
- </div>
182
-
183
-
184
-
185
-
186
- </div>
187
-
188
-
189
- <div id="method-i-test_valid_phone_number" class="method-detail ">
190
-
191
- <div class="method-heading">
192
- <span class="method-name">test_valid_phone_number</span><span
193
- class="method-args">()</span>
194
-
195
- <span class="method-click-advice">click to toggle source</span>
196
-
197
- </div>
198
-
199
-
200
- <div class="method-description">
201
-
202
- <p>This test inputs a valid phone number and expects the output to be
203
- <strong>true</strong></p>
204
-
205
-
206
-
207
-
208
- <div class="method-source-code" id="test_valid_phone_number-source">
209
- <pre><span class="ruby-comment"># File test/test_phone_number_validator.rb, line 13</span>
210
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_valid_phone_number</span>
211
- <span class="ruby-identifier">assert_equal</span> <span class="ruby-keyword">true</span>,
212
- <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-string">&#39;+1 (987) 654-3210 ext. 198842&#39;</span>)
213
- <span class="ruby-keyword">end</span></pre>
214
- </div>
215
-
216
- </div>
217
-
218
-
219
-
220
-
221
- </div>
222
-
223
-
224
- </section>
225
-
226
- </section>
227
- </main>
228
-
229
-
230
- <footer id="validator-badges" role="contentinfo">
231
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
232
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.1.
233
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
234
- </footer>
235
-
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class PhoneNumberValidatorTest - 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">Test::Unit::TestCase
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-i-test_invalid_phone_number">#test_invalid_phone_number</a>
76
+
77
+ <li ><a href="#method-i-test_no_phone_number">#test_no_phone_number</a>
78
+
79
+ <li ><a href="#method-i-test_valid_phone_number">#test_valid_phone_number</a>
80
+
81
+ </ul>
82
+ </div>
83
+
84
+ </div>
85
+ </nav>
86
+
87
+ <main role="main" aria-labelledby="class-PhoneNumberValidatorTest">
88
+ <h1 id="class-PhoneNumberValidatorTest" class="class">
89
+ class PhoneNumberValidatorTest
90
+ </h1>
91
+
92
+ <section class="description">
93
+
94
+ <p>This class represents the testing-unit for this gem app</p>
95
+
96
+ <p><strong>Inherits from:</strong></p>
97
+
98
+ <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>
99
+ </pre>
100
+
101
+ </section>
102
+
103
+
104
+ <section id="5Buntitled-5D" class="documentation-section">
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
115
+ <header>
116
+ <h3>Public Instance Methods</h3>
117
+ </header>
118
+
119
+
120
+ <div id="method-i-test_invalid_phone_number" class="method-detail ">
121
+
122
+ <div class="method-heading">
123
+ <span class="method-name">test_invalid_phone_number</span><span
124
+ class="method-args">()</span>
125
+
126
+ <span class="method-click-advice">click to toggle source</span>
127
+
128
+ </div>
129
+
130
+
131
+ <div class="method-description">
132
+
133
+ <p>This test inputs an invalid phone number and expects the output to be <strong>false</strong></p>
134
+
135
+
136
+
137
+
138
+ <div class="method-source-code" id="test_invalid_phone_number-source">
139
+ <pre><span class="ruby-comment"># File test/test_phone_number_validator.rb, line 20</span>
140
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_invalid_phone_number</span>
141
+ <span class="ruby-identifier">assert_equal</span> <span class="ruby-keyword">false</span>,
142
+ <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-string">&#39;94643823637337&#39;</span>)
143
+ <span class="ruby-keyword">end</span></pre>
144
+ </div>
145
+
146
+ </div>
147
+
148
+
149
+
150
+
151
+ </div>
152
+
153
+
154
+ <div id="method-i-test_no_phone_number" class="method-detail ">
155
+
156
+ <div class="method-heading">
157
+ <span class="method-name">test_no_phone_number</span><span
158
+ class="method-args">()</span>
159
+
160
+ <span class="method-click-advice">click to toggle source</span>
161
+
162
+ </div>
163
+
164
+
165
+ <div class="method-description">
166
+
167
+ <p>This test inputs no phone number and expects the output to be <strong>nil</strong></p>
168
+
169
+
170
+
171
+
172
+ <div class="method-source-code" id="test_no_phone_number-source">
173
+ <pre><span class="ruby-comment"># File test/test_phone_number_validator.rb, line 27</span>
174
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_no_phone_number</span>
175
+ <span class="ruby-identifier">assert_equal</span> <span class="ruby-value">:nil</span>,
176
+ <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-string">&#39;&#39;</span>)
177
+ <span class="ruby-keyword">end</span></pre>
178
+ </div>
179
+
180
+ </div>
181
+
182
+
183
+
184
+
185
+ </div>
186
+
187
+
188
+ <div id="method-i-test_valid_phone_number" class="method-detail ">
189
+
190
+ <div class="method-heading">
191
+ <span class="method-name">test_valid_phone_number</span><span
192
+ class="method-args">()</span>
193
+
194
+ <span class="method-click-advice">click to toggle source</span>
195
+
196
+ </div>
197
+
198
+
199
+ <div class="method-description">
200
+
201
+ <p>This test inputs a valid phone number and expects the output to be <strong>true</strong></p>
202
+
203
+
204
+
205
+
206
+ <div class="method-source-code" id="test_valid_phone_number-source">
207
+ <pre><span class="ruby-comment"># File test/test_phone_number_validator.rb, line 13</span>
208
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_valid_phone_number</span>
209
+ <span class="ruby-identifier">assert_equal</span> <span class="ruby-keyword">true</span>,
210
+ <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-string">&#39;+1 (987) 654-3210 ext. 198842&#39;</span>)
211
+ <span class="ruby-keyword">end</span></pre>
212
+ </div>
213
+
214
+ </div>
215
+
216
+
217
+
218
+
219
+ </div>
220
+
221
+
222
+ </section>
223
+
224
+ </section>
225
+
226
+ </main>
227
+
228
+
229
+ <footer id="validator-badges" role="contentinfo">
230
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
231
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
232
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
233
+ </footer>
234
+