print_primes_table 0.0.2
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 +7 -0
- data/.gitignore +12 -0
- data/.travis.yml +3 -0
- data/.yardoc/checksums +10 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +14 -0
- data/LICENSE.txt +22 -0
- data/README.md +78 -0
- data/Rakefile +2 -0
- data/bin/print_primes_table +10 -0
- data/doc/PrintPrimesTable.html +146 -0
- data/doc/PrintPrimesTable/Client.html +368 -0
- data/doc/PrintPrimesTable/Options.html +142 -0
- data/doc/PrintPrimesTable/Options/DefaultOption.html +247 -0
- data/doc/PrintPrimesTable/Options/HelpOption.html +311 -0
- data/doc/PrintPrimesTable/Options/OnlyPrimesOption.html +289 -0
- data/doc/PrintPrimesTable/Primes.html +496 -0
- data/doc/PrintPrimesTable/Validators.html +142 -0
- data/doc/PrintPrimesTable/Validators/DefaultValidator.html +284 -0
- data/doc/PrintPrimesTable/Validators/ErrorMessage.html +405 -0
- data/doc/PrintPrimesTable/Validators/HelpValidator.html +285 -0
- data/doc/_index.html +228 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +122 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +122 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +135 -0
- data/doc/top-level-namespace.html +131 -0
- data/features/command_print_primes_table.feature +57 -0
- data/features/help_option.feature +24 -0
- data/features/support/env.rb +2 -0
- data/features/validate_arguments.feature +14 -0
- data/lib/print_primes_table.rb +4 -0
- data/lib/print_primes_table/client.rb +40 -0
- data/lib/print_primes_table/options/default_option.rb +28 -0
- data/lib/print_primes_table/options/help_option.rb +47 -0
- data/lib/print_primes_table/options/only_primes_option.rb +29 -0
- data/lib/print_primes_table/primes.rb +52 -0
- data/lib/print_primes_table/validators/default_validator.rb +39 -0
- data/lib/print_primes_table/validators/error_message.rb +31 -0
- data/lib/print_primes_table/validators/help_validator.rb +28 -0
- data/lib/print_primes_table/version.rb +10 -0
- data/print_primes_table.gemspec +29 -0
- metadata +132 -0
@@ -0,0 +1,142 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: PrintPrimesTable::Options
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!PrintPrimesTable/Options.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (O)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../PrintPrimesTable.html" title="PrintPrimesTable (module)">PrintPrimesTable</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Options</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: PrintPrimesTable::Options
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/print_primes_table/options/default_option.rb<span class="defines">,<br />
|
83
|
+
lib/print_primes_table/options/help_option.rb,<br /> lib/print_primes_table/options/only_primes_option.rb</span>
|
84
|
+
</dd>
|
85
|
+
|
86
|
+
</dl>
|
87
|
+
<div class="clear"></div>
|
88
|
+
|
89
|
+
<h2>Overview</h2><div class="docstring">
|
90
|
+
<div class="discussion">
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<div class="tags">
|
96
|
+
|
97
|
+
<p class="tag_title">Author:</p>
|
98
|
+
<ul class="author">
|
99
|
+
|
100
|
+
<li>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<div class='inline'>
|
107
|
+
<p>Diego Hernán Piccinini Lagos</p>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</li>
|
111
|
+
|
112
|
+
</ul>
|
113
|
+
|
114
|
+
</div><h2>Defined Under Namespace</h2>
|
115
|
+
<p class="children">
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Options/DefaultOption.html" title="PrintPrimesTable::Options::DefaultOption (class)">DefaultOption</a></span>, <span class='object_link'><a href="Options/HelpOption.html" title="PrintPrimesTable::Options::HelpOption (class)">HelpOption</a></span>, <span class='object_link'><a href="Options/OnlyPrimesOption.html" title="PrintPrimesTable::Options::OnlyPrimesOption (class)">OnlyPrimesOption</a></span>
|
121
|
+
|
122
|
+
|
123
|
+
</p>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div id="footer">
|
136
|
+
Generated on Thu Apr 9 11:19:34 2015 by
|
137
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
138
|
+
0.8.7.6 (ruby-2.0.0).
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</body>
|
142
|
+
</html>
|
@@ -0,0 +1,247 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: PrintPrimesTable::Options::DefaultOption
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!PrintPrimesTable/Options/DefaultOption.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (D)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../PrintPrimesTable.html" title="PrintPrimesTable (module)">PrintPrimesTable</a></span></span> » <span class='title'><span class='object_link'><a href="../Options.html" title="PrintPrimesTable::Options (module)">Options</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">DefaultOption</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: PrintPrimesTable::Options::DefaultOption
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">PrintPrimesTable::Options::DefaultOption</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/print_primes_table/options/default_option.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h2>
|
111
|
+
Class Method Summary
|
112
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
113
|
+
</h2>
|
114
|
+
|
115
|
+
<ul class="summary">
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#process-class_method" title="process (class method)">+ (Object) <strong>process</strong>(args) </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<span class="summary_desc"><div class='inline'>
|
135
|
+
<p>procces the default option to print the table.</p>
|
136
|
+
</div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
</ul>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<div id="class_method_details" class="method_details_list">
|
147
|
+
<h2>Class Method Details</h2>
|
148
|
+
|
149
|
+
|
150
|
+
<div class="method_details first">
|
151
|
+
<h3 class="signature first" id="process-class_method">
|
152
|
+
|
153
|
+
+ (<tt>Object</tt>) <strong>process</strong>(args)
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</h3><div class="docstring">
|
160
|
+
<div class="discussion">
|
161
|
+
|
162
|
+
<p>procces the default option to print the table. The validator print an error
|
163
|
+
if there is an exception</p>
|
164
|
+
|
165
|
+
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
<div class="tags">
|
169
|
+
<p class="tag_title">Parameters:</p>
|
170
|
+
<ul class="param">
|
171
|
+
|
172
|
+
<li>
|
173
|
+
|
174
|
+
<span class='name'>args</span>
|
175
|
+
|
176
|
+
|
177
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
—
|
182
|
+
<div class='inline'>
|
183
|
+
<p>the first argument is a integer quantity of prime collection</p>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
</li>
|
187
|
+
|
188
|
+
</ul>
|
189
|
+
|
190
|
+
|
191
|
+
</div><table class="source_code">
|
192
|
+
<tr>
|
193
|
+
<td>
|
194
|
+
<pre class="lines">
|
195
|
+
|
196
|
+
|
197
|
+
10
|
198
|
+
11
|
199
|
+
12
|
200
|
+
13
|
201
|
+
14
|
202
|
+
15
|
203
|
+
16
|
204
|
+
17
|
205
|
+
18
|
206
|
+
19
|
207
|
+
20
|
208
|
+
21
|
209
|
+
22
|
210
|
+
23
|
211
|
+
24</pre>
|
212
|
+
</td>
|
213
|
+
<td>
|
214
|
+
<pre class="code"><span class="info file"># File 'lib/print_primes_table/options/default_option.rb', line 10</span>
|
215
|
+
|
216
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
217
|
+
<span class='id identifier rubyid_validator'>validator</span> <span class='op'>=</span> <span class='const'>Validators</span><span class='op'>::</span><span class='const'>DefaultValidator</span><span class='period'>.</span><span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
218
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_validator'>validator</span> <span class='op'>==</span> <span class='symbol'>:valid</span>
|
219
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='op'>></span><span class='int'>0</span>
|
220
|
+
<span class='id identifier rubyid_total'>total</span> <span class='op'>=</span> <span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
221
|
+
<span class='id identifier rubyid_primes'>primes</span> <span class='op'>=</span> <span class='const'>Primes</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_total'>total</span>
|
222
|
+
<span class='kw'>else</span>
|
223
|
+
<span class='id identifier rubyid_primes'>primes</span><span class='op'>=</span> <span class='const'>Primes</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
224
|
+
<span class='kw'>end</span>
|
225
|
+
<span class='id identifier rubyid_primes'>primes</span><span class='period'>.</span><span class='id identifier rubyid_print_table'>print_table</span>
|
226
|
+
|
227
|
+
<span class='kw'>else</span>
|
228
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_validator'>validator</span>
|
229
|
+
<span class='kw'>end</span>
|
230
|
+
<span class='kw'>end</span></pre>
|
231
|
+
</td>
|
232
|
+
</tr>
|
233
|
+
</table>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
</div>
|
237
|
+
|
238
|
+
</div>
|
239
|
+
|
240
|
+
<div id="footer">
|
241
|
+
Generated on Thu Apr 9 11:19:34 2015 by
|
242
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
243
|
+
0.8.7.6 (ruby-2.0.0).
|
244
|
+
</div>
|
245
|
+
|
246
|
+
</body>
|
247
|
+
</html>
|
@@ -0,0 +1,311 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: PrintPrimesTable::Options::HelpOption
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!PrintPrimesTable/Options/HelpOption.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (H)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../PrintPrimesTable.html" title="PrintPrimesTable (module)">PrintPrimesTable</a></span></span> » <span class='title'><span class='object_link'><a href="../Options.html" title="PrintPrimesTable::Options (module)">Options</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">HelpOption</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: PrintPrimesTable::Options::HelpOption
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">PrintPrimesTable::Options::HelpOption</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/print_primes_table/options/help_option.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>to handle the help messages output</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
<p class="tag_title">Author:</p>
|
113
|
+
<ul class="author">
|
114
|
+
|
115
|
+
<li>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<div class='inline'>
|
122
|
+
<p>Diego Hernán Piccinini Lagos</p>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
</li>
|
126
|
+
|
127
|
+
</ul>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
<h2>Constant Summary</h2>
|
131
|
+
|
132
|
+
<dl class="constants">
|
133
|
+
|
134
|
+
<dt id="MESSAGE-constant" class="">MESSAGE =
|
135
|
+
|
136
|
+
</dt>
|
137
|
+
<dd><pre class="code"><span class='lbrace'>{</span><span class='symbol'>:headings</span><span class='op'>=></span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Option</span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Description</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
138
|
+
<span class='symbol'>:rows</span> <span class='op'>=></span> <span class='lbracket'>[</span>
|
139
|
+
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default\n\nwithout\noption</span><span class='tstring_end'>"</span></span> <span class='comma'>,</span> <span class='heredoc_beg'><<EOF</span>
|
140
|
+
<span class='tstring_content'>Print a table across the top and down the left
|
141
|
+
side are the 10 primes, and the body of the table
|
142
|
+
should contain the product of multiplying these numbers.
|
143
|
+
This option accept one param the quantity.
|
144
|
+
For example, if you want to print 20 type this
|
145
|
+
print_table_primes 20
|
146
|
+
</span><span class='heredoc_end'>EOF
|
147
|
+
</span><span class='rbracket'>]</span><span class='comma'>,</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
148
|
+
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>--only-primes</span><span class='tstring_end'>"</span></span> <span class='comma'>,</span> <span class='heredoc_beg'><<EOF</span>
|
149
|
+
<span class='tstring_content'>Print a list of 10 primes.
|
150
|
+
This option accept one param the quantity.
|
151
|
+
For example, if you want to print 20 type this
|
152
|
+
print_table_primes --only-primes 20
|
153
|
+
</span><span class='heredoc_end'>EOF
|
154
|
+
</span><span class='rbracket'>]</span><span class='comma'>,</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
155
|
+
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>--only-primes</span><span class='tstring_end'>"</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Print this help.</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
156
|
+
<span class='rbracket'>]</span>
|
157
|
+
<span class='rbrace'>}</span></pre></dd>
|
158
|
+
|
159
|
+
</dl>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<h2>
|
170
|
+
Class Method Summary
|
171
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
172
|
+
</h2>
|
173
|
+
|
174
|
+
<ul class="summary">
|
175
|
+
|
176
|
+
<li class="public ">
|
177
|
+
<span class="summary_signature">
|
178
|
+
|
179
|
+
<a href="#process-class_method" title="process (class method)">+ (Object) <strong>process</strong>(args, options) </a>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</span>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<span class="summary_desc"><div class='inline'>
|
194
|
+
<p>process the –help option to show the options availables.</p>
|
195
|
+
</div></span>
|
196
|
+
|
197
|
+
</li>
|
198
|
+
|
199
|
+
|
200
|
+
</ul>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<div id="class_method_details" class="method_details_list">
|
206
|
+
<h2>Class Method Details</h2>
|
207
|
+
|
208
|
+
|
209
|
+
<div class="method_details first">
|
210
|
+
<h3 class="signature first" id="process-class_method">
|
211
|
+
|
212
|
+
+ (<tt>Object</tt>) <strong>process</strong>(args, options)
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</h3><div class="docstring">
|
219
|
+
<div class="discussion">
|
220
|
+
|
221
|
+
<p>process the –help option to show the options availables.</p>
|
222
|
+
|
223
|
+
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
<div class="tags">
|
227
|
+
<p class="tag_title">Parameters:</p>
|
228
|
+
<ul class="param">
|
229
|
+
|
230
|
+
<li>
|
231
|
+
|
232
|
+
<span class='name'>args</span>
|
233
|
+
|
234
|
+
|
235
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
—
|
240
|
+
<div class='inline'>
|
241
|
+
<p>in this case is empty at first</p>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
</li>
|
245
|
+
|
246
|
+
<li>
|
247
|
+
|
248
|
+
<span class='name'>options</span>
|
249
|
+
|
250
|
+
|
251
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
—
|
256
|
+
<div class='inline'>
|
257
|
+
<p>if in future we will want to add options</p>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
</li>
|
261
|
+
|
262
|
+
</ul>
|
263
|
+
|
264
|
+
|
265
|
+
</div><table class="source_code">
|
266
|
+
<tr>
|
267
|
+
<td>
|
268
|
+
<pre class="lines">
|
269
|
+
|
270
|
+
|
271
|
+
34
|
272
|
+
35
|
273
|
+
36
|
274
|
+
37
|
275
|
+
38
|
276
|
+
39
|
277
|
+
40
|
278
|
+
41
|
279
|
+
42
|
280
|
+
43</pre>
|
281
|
+
</td>
|
282
|
+
<td>
|
283
|
+
<pre class="code"><span class="info file"># File 'lib/print_primes_table/options/help_option.rb', line 34</span>
|
284
|
+
|
285
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
286
|
+
<span class='id identifier rubyid_validator'>validator</span> <span class='op'>=</span> <span class='const'>Validators</span><span class='op'>::</span><span class='const'>HelpValidator</span><span class='period'>.</span><span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
287
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_validator'>validator</span> <span class='op'>==</span> <span class='symbol'>:valid</span>
|
288
|
+
|
289
|
+
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='const'>Terminal</span><span class='op'>::</span><span class='const'>Table</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='symbol'>:headings</span> <span class='op'>=></span> <span class='const'>MESSAGE</span><span class='lbracket'>[</span><span class='symbol'>:headings</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:rows</span> <span class='op'>=></span> <span class='const'>MESSAGE</span><span class='lbracket'>[</span><span class='symbol'>:rows</span><span class='rbracket'>]</span>
|
290
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_table'>table</span>
|
291
|
+
<span class='kw'>else</span>
|
292
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_validator'>validator</span>
|
293
|
+
<span class='kw'>end</span>
|
294
|
+
<span class='kw'>end</span></pre>
|
295
|
+
</td>
|
296
|
+
</tr>
|
297
|
+
</table>
|
298
|
+
</div>
|
299
|
+
|
300
|
+
</div>
|
301
|
+
|
302
|
+
</div>
|
303
|
+
|
304
|
+
<div id="footer">
|
305
|
+
Generated on Thu Apr 9 11:19:34 2015 by
|
306
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
307
|
+
0.8.7.6 (ruby-2.0.0).
|
308
|
+
</div>
|
309
|
+
|
310
|
+
</body>
|
311
|
+
</html>
|