term_utils 0.1.1 → 0.4.0
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 +4 -4
- data/AUTHORS +1 -0
- data/CHANGELOG.md +51 -0
- data/COPYING +674 -0
- data/README.md +99 -0
- data/Rakefile +55 -0
- data/doc/TermUtils.html +138 -0
- data/doc/TermUtils/AP.html +394 -0
- data/doc/TermUtils/AP/Article.html +993 -0
- data/doc/TermUtils/AP/ArticleResult.html +584 -0
- data/doc/TermUtils/AP/Flag.html +756 -0
- data/doc/TermUtils/AP/NoSuchValueError.html +217 -0
- data/doc/TermUtils/AP/Parameter.html +1592 -0
- data/doc/TermUtils/AP/ParameterResult.html +980 -0
- data/doc/TermUtils/AP/ParameterWalkerHooks.html +409 -0
- data/doc/TermUtils/AP/ParseError.html +217 -0
- data/doc/TermUtils/AP/Parser.html +604 -0
- data/doc/TermUtils/AP/Result.html +837 -0
- data/doc/TermUtils/AP/Syntax.html +761 -0
- data/doc/TermUtils/AP/SyntaxError.html +217 -0
- data/doc/TermUtils/AP/Walker.html +686 -0
- data/doc/TermUtils/FF.html +128 -0
- data/doc/TermUtils/FF/Config.html +774 -0
- data/doc/TermUtils/FF/Context.html +585 -0
- data/doc/TermUtils/FF/Entry.html +626 -0
- data/doc/TermUtils/FF/Query.html +1085 -0
- data/doc/TermUtils/PropertyTreeNode.html +2113 -0
- data/doc/TermUtils/Tab.html +1486 -0
- data/doc/TermUtils/Tab/Column.html +1263 -0
- data/doc/TermUtils/Tab/Header.html +536 -0
- data/doc/TermUtils/Tab/Holder.html +1210 -0
- data/doc/TermUtils/Tab/Printer.html +967 -0
- data/doc/TermUtils/Tab/Table.html +1966 -0
- data/doc/TermUtils/Tab/TableError.html +217 -0
- data/doc/_index.html +387 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +170 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +170 -0
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1539 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/term_utils.rb +11 -0
- data/lib/term_utils/ap.rb +70 -0
- data/lib/term_utils/ap/article.rb +74 -0
- data/lib/term_utils/ap/flag.rb +65 -0
- data/lib/term_utils/ap/parameter.rb +144 -0
- data/lib/term_utils/ap/parser.rb +211 -0
- data/lib/term_utils/ap/result.rb +244 -0
- data/lib/term_utils/ap/syntax.rb +96 -0
- data/lib/term_utils/ff.rb +27 -0
- data/lib/term_utils/ff/config.rb +55 -0
- data/lib/term_utils/ff/entry.rb +45 -0
- data/lib/term_utils/ff/query.rb +145 -0
- data/lib/term_utils/property_tree_node.rb +228 -0
- data/lib/term_utils/tab.rb +338 -88
- data/term_utils.gemspec +16 -0
- metadata +69 -7
@@ -0,0 +1,761 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: TermUtils::AP::Syntax
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.25
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "TermUtils::AP::Syntax";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (S)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span> » <span class='title'><span class='object_link'><a href="../AP.html" title="TermUtils::AP (module)">AP</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Syntax</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: TermUtils::AP::Syntax
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">TermUtils::AP::Syntax</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/term_utils/ap/syntax.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Represents the argument list syntax. It holds a list of parameters.</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
118
|
+
<ul class="summary">
|
119
|
+
|
120
|
+
<li class="public ">
|
121
|
+
<span class="summary_signature">
|
122
|
+
|
123
|
+
<a href="#parameters-instance_method" title="#parameters (instance method)">#<strong>parameters</strong> ⇒ Array<Parameter> </a>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
</span>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
141
|
+
|
142
|
+
</li>
|
143
|
+
|
144
|
+
|
145
|
+
</ul>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
<h2>
|
152
|
+
Instance Method Summary
|
153
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
154
|
+
</h2>
|
155
|
+
|
156
|
+
<ul class="summary">
|
157
|
+
|
158
|
+
<li class="public ">
|
159
|
+
<span class="summary_signature">
|
160
|
+
|
161
|
+
<a href="#define_parameter-instance_method" title="#define_parameter (instance method)">#<strong>define_parameter</strong>(id = nil, opts = {}, &block) ⇒ Parameter </a>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
</span>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<span class="summary_desc"><div class='inline'>
|
176
|
+
<p>Creates and adds a new Parameter.</p>
|
177
|
+
</div></span>
|
178
|
+
|
179
|
+
</li>
|
180
|
+
|
181
|
+
|
182
|
+
<li class="public ">
|
183
|
+
<span class="summary_signature">
|
184
|
+
|
185
|
+
<a href="#fetch_parameters-instance_method" title="#fetch_parameters (instance method)">#<strong>fetch_parameters</strong> ⇒ Array </a>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
</span>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<span class="summary_desc"><div class='inline'>
|
200
|
+
<p>Fetches all flagged parameters and unflagged parameters.</p>
|
201
|
+
</div></span>
|
202
|
+
|
203
|
+
</li>
|
204
|
+
|
205
|
+
|
206
|
+
<li class="public ">
|
207
|
+
<span class="summary_signature">
|
208
|
+
|
209
|
+
<a href="#finalize!-instance_method" title="#finalize! (instance method)">#<strong>finalize!</strong>(opts = {}) ⇒ nil </a>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
</span>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
<span class="summary_desc"><div class='inline'>
|
224
|
+
<p>Finalizes this one.</p>
|
225
|
+
</div></span>
|
226
|
+
|
227
|
+
</li>
|
228
|
+
|
229
|
+
|
230
|
+
<li class="public ">
|
231
|
+
<span class="summary_signature">
|
232
|
+
|
233
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Syntax </a>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
</span>
|
238
|
+
|
239
|
+
|
240
|
+
<span class="note title constructor">constructor</span>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<span class="summary_desc"><div class='inline'>
|
250
|
+
<p>Constructs a new Syntax.</p>
|
251
|
+
</div></span>
|
252
|
+
|
253
|
+
</li>
|
254
|
+
|
255
|
+
|
256
|
+
<li class="public ">
|
257
|
+
<span class="summary_signature">
|
258
|
+
|
259
|
+
<a href="#initialize_dup-instance_method" title="#initialize_dup (instance method)">#<strong>initialize_dup</strong>(other) ⇒ Object </a>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
</span>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
<span class="summary_desc"><div class='inline'>
|
274
|
+
<p>For dup method.</p>
|
275
|
+
</div></span>
|
276
|
+
|
277
|
+
</li>
|
278
|
+
|
279
|
+
|
280
|
+
</ul>
|
281
|
+
|
282
|
+
|
283
|
+
<div id="constructor_details" class="method_details_list">
|
284
|
+
<h2>Constructor Details</h2>
|
285
|
+
|
286
|
+
<div class="method_details first">
|
287
|
+
<h3 class="signature first" id="initialize-instance_method">
|
288
|
+
|
289
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="TermUtils::AP::Syntax (class)">Syntax</a></span></tt>
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
</h3><div class="docstring">
|
296
|
+
<div class="discussion">
|
297
|
+
|
298
|
+
<p>Constructs a new Syntax.</p>
|
299
|
+
|
300
|
+
|
301
|
+
</div>
|
302
|
+
</div>
|
303
|
+
<div class="tags">
|
304
|
+
|
305
|
+
|
306
|
+
</div><table class="source_code">
|
307
|
+
<tr>
|
308
|
+
<td>
|
309
|
+
<pre class="lines">
|
310
|
+
|
311
|
+
|
312
|
+
27
|
313
|
+
28
|
314
|
+
29</pre>
|
315
|
+
</td>
|
316
|
+
<td>
|
317
|
+
<pre class="code"><span class="info file"># File 'lib/term_utils/ap/syntax.rb', line 27</span>
|
318
|
+
|
319
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
320
|
+
<span class='ivar'>@parameters</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
321
|
+
<span class='kw'>end</span></pre>
|
322
|
+
</td>
|
323
|
+
</tr>
|
324
|
+
</table>
|
325
|
+
</div>
|
326
|
+
|
327
|
+
</div>
|
328
|
+
|
329
|
+
<div id="instance_attr_details" class="attr_details">
|
330
|
+
<h2>Instance Attribute Details</h2>
|
331
|
+
|
332
|
+
|
333
|
+
<span id="parameters=-instance_method"></span>
|
334
|
+
<div class="method_details first">
|
335
|
+
<h3 class="signature first" id="parameters-instance_method">
|
336
|
+
|
337
|
+
#<strong>parameters</strong> ⇒ <tt>Array<<span class='object_link'><a href="Parameter.html" title="TermUtils::AP::Parameter (class)">Parameter</a></span>></tt>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
</h3><div class="docstring">
|
344
|
+
<div class="discussion">
|
345
|
+
|
346
|
+
|
347
|
+
</div>
|
348
|
+
</div>
|
349
|
+
<div class="tags">
|
350
|
+
|
351
|
+
<p class="tag_title">Returns:</p>
|
352
|
+
<ul class="return">
|
353
|
+
|
354
|
+
<li>
|
355
|
+
|
356
|
+
|
357
|
+
<span class='type'>(<tt>Array<<span class='object_link'><a href="Parameter.html" title="TermUtils::AP::Parameter (class)">Parameter</a></span>></tt>)</span>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
</li>
|
362
|
+
|
363
|
+
</ul>
|
364
|
+
|
365
|
+
</div><table class="source_code">
|
366
|
+
<tr>
|
367
|
+
<td>
|
368
|
+
<pre class="lines">
|
369
|
+
|
370
|
+
|
371
|
+
24
|
372
|
+
25
|
373
|
+
26</pre>
|
374
|
+
</td>
|
375
|
+
<td>
|
376
|
+
<pre class="code"><span class="info file"># File 'lib/term_utils/ap/syntax.rb', line 24</span>
|
377
|
+
|
378
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parameters'>parameters</span>
|
379
|
+
<span class='ivar'>@parameters</span>
|
380
|
+
<span class='kw'>end</span></pre>
|
381
|
+
</td>
|
382
|
+
</tr>
|
383
|
+
</table>
|
384
|
+
</div>
|
385
|
+
|
386
|
+
</div>
|
387
|
+
|
388
|
+
|
389
|
+
<div id="instance_method_details" class="method_details_list">
|
390
|
+
<h2>Instance Method Details</h2>
|
391
|
+
|
392
|
+
|
393
|
+
<div class="method_details first">
|
394
|
+
<h3 class="signature first" id="define_parameter-instance_method">
|
395
|
+
|
396
|
+
#<strong>define_parameter</strong>(id = nil, opts = {}, &block) ⇒ <tt><span class='object_link'><a href="Parameter.html" title="TermUtils::AP::Parameter (class)">Parameter</a></span></tt>
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
</h3><div class="docstring">
|
403
|
+
<div class="discussion">
|
404
|
+
|
405
|
+
<p>Creates and adds a new Parameter.</p>
|
406
|
+
|
407
|
+
|
408
|
+
</div>
|
409
|
+
</div>
|
410
|
+
<div class="tags">
|
411
|
+
<p class="tag_title">Parameters:</p>
|
412
|
+
<ul class="param">
|
413
|
+
|
414
|
+
<li>
|
415
|
+
|
416
|
+
<span class='name'>id</span>
|
417
|
+
|
418
|
+
|
419
|
+
<span class='type'>(<tt>Symbol</tt>, <tt>nil</tt>)</span>
|
420
|
+
|
421
|
+
|
422
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
423
|
+
|
424
|
+
|
425
|
+
</li>
|
426
|
+
|
427
|
+
<li>
|
428
|
+
|
429
|
+
<span class='name'>opts</span>
|
430
|
+
|
431
|
+
|
432
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
433
|
+
|
434
|
+
|
435
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
436
|
+
|
437
|
+
|
438
|
+
</li>
|
439
|
+
|
440
|
+
</ul>
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
448
|
+
<ul class="option">
|
449
|
+
|
450
|
+
<li>
|
451
|
+
<span class="name">:id</span>
|
452
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
453
|
+
<span class="default">
|
454
|
+
|
455
|
+
</span>
|
456
|
+
|
457
|
+
</li>
|
458
|
+
|
459
|
+
<li>
|
460
|
+
<span class="name">:min_occurs</span>
|
461
|
+
<span class="type">(<tt>Integer</tt>)</span>
|
462
|
+
<span class="default">
|
463
|
+
|
464
|
+
</span>
|
465
|
+
|
466
|
+
</li>
|
467
|
+
|
468
|
+
<li>
|
469
|
+
<span class="name">:max_occurs</span>
|
470
|
+
<span class="type">(<tt>Integer</tt>)</span>
|
471
|
+
<span class="default">
|
472
|
+
|
473
|
+
</span>
|
474
|
+
|
475
|
+
</li>
|
476
|
+
|
477
|
+
</ul>
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
<p class="tag_title">Returns:</p>
|
483
|
+
<ul class="return">
|
484
|
+
|
485
|
+
<li>
|
486
|
+
|
487
|
+
|
488
|
+
<span class='type'>(<tt><span class='object_link'><a href="Parameter.html" title="TermUtils::AP::Parameter (class)">Parameter</a></span></tt>)</span>
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
</li>
|
493
|
+
|
494
|
+
</ul>
|
495
|
+
|
496
|
+
</div><table class="source_code">
|
497
|
+
<tr>
|
498
|
+
<td>
|
499
|
+
<pre class="lines">
|
500
|
+
|
501
|
+
|
502
|
+
54
|
503
|
+
55
|
504
|
+
56
|
505
|
+
57
|
506
|
+
58
|
507
|
+
59
|
508
|
+
60
|
509
|
+
61
|
510
|
+
62
|
511
|
+
63
|
512
|
+
64
|
513
|
+
65
|
514
|
+
66
|
515
|
+
67
|
516
|
+
68</pre>
|
517
|
+
</td>
|
518
|
+
<td>
|
519
|
+
<pre class="code"><span class="info file"># File 'lib/term_utils/ap/syntax.rb', line 54</span>
|
520
|
+
|
521
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_define_parameter'>define_parameter</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
522
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_id'>id</span>
|
523
|
+
<span class='id identifier rubyid_param'>param</span> <span class='op'>=</span> <span class='ivar'>@parameters</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span> <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
|
524
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_param'>param</span>
|
525
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span>
|
526
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_param'>param</span>
|
527
|
+
<span class='kw'>end</span>
|
528
|
+
|
529
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_id'>id</span>
|
530
|
+
<span class='kw'>end</span>
|
531
|
+
<span class='id identifier rubyid_new_parameter'>new_parameter</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../AP.html" title="TermUtils::AP (module)">AP</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Parameter.html" title="TermUtils::AP::Parameter (class)">Parameter</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Parameter.html#initialize-instance_method" title="TermUtils::AP::Parameter#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
532
|
+
<span class='ivar'>@parameters</span> <span class='op'><<</span> <span class='id identifier rubyid_new_parameter'>new_parameter</span>
|
533
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_new_parameter'>new_parameter</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span>
|
534
|
+
<span class='id identifier rubyid_new_parameter'>new_parameter</span>
|
535
|
+
<span class='kw'>end</span></pre>
|
536
|
+
</td>
|
537
|
+
</tr>
|
538
|
+
</table>
|
539
|
+
</div>
|
540
|
+
|
541
|
+
<div class="method_details ">
|
542
|
+
<h3 class="signature " id="fetch_parameters-instance_method">
|
543
|
+
|
544
|
+
#<strong>fetch_parameters</strong> ⇒ <tt>Array</tt>
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
</h3><div class="docstring">
|
551
|
+
<div class="discussion">
|
552
|
+
|
553
|
+
<p>Fetches all flagged parameters and unflagged parameters.</p>
|
554
|
+
|
555
|
+
|
556
|
+
</div>
|
557
|
+
</div>
|
558
|
+
<div class="tags">
|
559
|
+
|
560
|
+
<p class="tag_title">Returns:</p>
|
561
|
+
<ul class="return">
|
562
|
+
|
563
|
+
<li>
|
564
|
+
|
565
|
+
|
566
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
</li>
|
571
|
+
|
572
|
+
</ul>
|
573
|
+
|
574
|
+
</div><table class="source_code">
|
575
|
+
<tr>
|
576
|
+
<td>
|
577
|
+
<pre class="lines">
|
578
|
+
|
579
|
+
|
580
|
+
72
|
581
|
+
73
|
582
|
+
74
|
583
|
+
75
|
584
|
+
76
|
585
|
+
77
|
586
|
+
78
|
587
|
+
79
|
588
|
+
80
|
589
|
+
81
|
590
|
+
82
|
591
|
+
83
|
592
|
+
84
|
593
|
+
85
|
594
|
+
86
|
595
|
+
87
|
596
|
+
88
|
597
|
+
89
|
598
|
+
90
|
599
|
+
91
|
600
|
+
92
|
601
|
+
93</pre>
|
602
|
+
</td>
|
603
|
+
<td>
|
604
|
+
<pre class="code"><span class="info file"># File 'lib/term_utils/ap/syntax.rb', line 72</span>
|
605
|
+
|
606
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_parameters'>fetch_parameters</span>
|
607
|
+
<span class='id identifier rubyid_unflagged_params'>unflagged_params</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
608
|
+
<span class='id identifier rubyid_flagged_params'>flagged_params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
609
|
+
<span class='id identifier rubyid_shortcut_flags'>shortcut_flags</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
610
|
+
<span class='ivar'>@parameters</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span>
|
611
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_flagged?'>flagged?</span>
|
612
|
+
<span class='comment'># Flagged
|
613
|
+
</span> <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_flags'>flags</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
|
614
|
+
<span class='id identifier rubyid_flagged_params'>flagged_params</span><span class='lbracket'>[</span><span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_p'>p</span>
|
615
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_long?'>long?</span>
|
616
|
+
<span class='id identifier rubyid_shortcut_flags'>shortcut_flags</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_f'>f</span>
|
617
|
+
<span class='kw'>else</span>
|
618
|
+
<span class='id identifier rubyid_shortcut_flags'>shortcut_flags</span><span class='lbracket'>[</span><span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_f'>f</span>
|
619
|
+
<span class='kw'>end</span>
|
620
|
+
<span class='kw'>end</span>
|
621
|
+
<span class='kw'>else</span>
|
622
|
+
<span class='comment'># Unflagged
|
623
|
+
</span> <span class='id identifier rubyid_unflagged_params'>unflagged_params</span> <span class='op'><<</span> <span class='id identifier rubyid_p'>p</span>
|
624
|
+
<span class='kw'>end</span>
|
625
|
+
<span class='kw'>end</span>
|
626
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_unflagged_params'>unflagged_params</span><span class='comma'>,</span> <span class='id identifier rubyid_flagged_params'>flagged_params</span><span class='comma'>,</span> <span class='id identifier rubyid_shortcut_flags'>shortcut_flags</span><span class='rbracket'>]</span>
|
627
|
+
<span class='kw'>end</span></pre>
|
628
|
+
</td>
|
629
|
+
</tr>
|
630
|
+
</table>
|
631
|
+
</div>
|
632
|
+
|
633
|
+
<div class="method_details ">
|
634
|
+
<h3 class="signature " id="finalize!-instance_method">
|
635
|
+
|
636
|
+
#<strong>finalize!</strong>(opts = {}) ⇒ <tt>nil</tt>
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
</h3><div class="docstring">
|
643
|
+
<div class="discussion">
|
644
|
+
|
645
|
+
<p>Finalizes this one. Internal use.</p>
|
646
|
+
|
647
|
+
|
648
|
+
</div>
|
649
|
+
</div>
|
650
|
+
<div class="tags">
|
651
|
+
|
652
|
+
<p class="tag_title">Returns:</p>
|
653
|
+
<ul class="return">
|
654
|
+
|
655
|
+
<li>
|
656
|
+
|
657
|
+
|
658
|
+
<span class='type'>(<tt>nil</tt>)</span>
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
</li>
|
663
|
+
|
664
|
+
</ul>
|
665
|
+
<p class="tag_title">Raises:</p>
|
666
|
+
<ul class="raise">
|
667
|
+
|
668
|
+
<li>
|
669
|
+
|
670
|
+
|
671
|
+
<span class='type'>(<tt><span class='object_link'><a href="SyntaxError.html" title="TermUtils::AP::SyntaxError (class)">SyntaxError</a></span></tt>)</span>
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
</li>
|
676
|
+
|
677
|
+
</ul>
|
678
|
+
|
679
|
+
</div><table class="source_code">
|
680
|
+
<tr>
|
681
|
+
<td>
|
682
|
+
<pre class="lines">
|
683
|
+
|
684
|
+
|
685
|
+
40
|
686
|
+
41
|
687
|
+
42
|
688
|
+
43
|
689
|
+
44
|
690
|
+
45</pre>
|
691
|
+
</td>
|
692
|
+
<td>
|
693
|
+
<pre class="code"><span class="info file"># File 'lib/term_utils/ap/syntax.rb', line 40</span>
|
694
|
+
|
695
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_finalize!'>finalize!</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
696
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:anonymous</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='int'>0</span> <span class='kw'>unless</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span> <span class='symbol'>:anonymous</span>
|
697
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:flag_labels</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
698
|
+
<span class='ivar'>@parameters</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span> <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_finalize!'>finalize!</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
699
|
+
<span class='kw'>nil</span>
|
700
|
+
<span class='kw'>end</span></pre>
|
701
|
+
</td>
|
702
|
+
</tr>
|
703
|
+
</table>
|
704
|
+
</div>
|
705
|
+
|
706
|
+
<div class="method_details ">
|
707
|
+
<h3 class="signature " id="initialize_dup-instance_method">
|
708
|
+
|
709
|
+
#<strong>initialize_dup</strong>(other) ⇒ <tt>Object</tt>
|
710
|
+
|
711
|
+
|
712
|
+
|
713
|
+
|
714
|
+
|
715
|
+
</h3><div class="docstring">
|
716
|
+
<div class="discussion">
|
717
|
+
|
718
|
+
<p>For dup method.</p>
|
719
|
+
|
720
|
+
|
721
|
+
</div>
|
722
|
+
</div>
|
723
|
+
<div class="tags">
|
724
|
+
|
725
|
+
|
726
|
+
</div><table class="source_code">
|
727
|
+
<tr>
|
728
|
+
<td>
|
729
|
+
<pre class="lines">
|
730
|
+
|
731
|
+
|
732
|
+
32
|
733
|
+
33
|
734
|
+
34
|
735
|
+
35</pre>
|
736
|
+
</td>
|
737
|
+
<td>
|
738
|
+
<pre class="code"><span class="info file"># File 'lib/term_utils/ap/syntax.rb', line 32</span>
|
739
|
+
|
740
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize_dup'>initialize_dup</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
741
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
742
|
+
<span class='ivar'>@parameters</span> <span class='op'>=</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_parameters'>parameters</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:dup</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_parameters'>parameters</span>
|
743
|
+
<span class='kw'>end</span></pre>
|
744
|
+
</td>
|
745
|
+
</tr>
|
746
|
+
</table>
|
747
|
+
</div>
|
748
|
+
|
749
|
+
</div>
|
750
|
+
|
751
|
+
</div>
|
752
|
+
|
753
|
+
<div id="footer">
|
754
|
+
Generated on Sun Aug 2 18:35:10 2020 by
|
755
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
756
|
+
0.9.25 (ruby-2.6.5).
|
757
|
+
</div>
|
758
|
+
|
759
|
+
</div>
|
760
|
+
</body>
|
761
|
+
</html>
|