cw 0.0.8 → 0.0.9
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/.yardoc/checksums +33 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/cw.gemspec +1 -1
- data/doc/Alphabet.html +433 -0
- data/doc/AudioPlayer.html +805 -0
- data/doc/Book.html +3134 -0
- data/doc/BookDetails.html +664 -0
- data/doc/CW.html +849 -0
- data/doc/CWThreads.html +514 -0
- data/doc/Cl.html +1125 -0
- data/doc/CurrentWord.html +636 -0
- data/doc/CwDsl.html +1871 -0
- data/doc/CwEncoding.html +329 -0
- data/doc/FileDetails.html +236 -0
- data/doc/KeyInput.html +758 -0
- data/doc/MonitorKeys.html +482 -0
- data/doc/Numbers.html +433 -0
- data/doc/Params.html +352 -0
- data/doc/Print.html +1130 -0
- data/doc/Print/ProgressPrint.html +419 -0
- data/doc/Process.html +202 -0
- data/doc/Progress.html +337 -0
- data/doc/Randomize.html +959 -0
- data/doc/RepeatWord.html +816 -0
- data/doc/Rss.html +630 -0
- data/doc/Sentence.html +1457 -0
- data/doc/Spoken.html +215 -0
- data/doc/Str.html +771 -0
- data/doc/Stream.html +1401 -0
- data/doc/TestLetters.html +586 -0
- data/doc/TestWords.html +646 -0
- data/doc/Tester.html +3064 -0
- data/doc/Timing.html +1244 -0
- data/doc/ToneGenerator.html +2111 -0
- data/doc/Voice.html +273 -0
- data/doc/Words.html +1750 -0
- data/doc/_index.html +376 -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 +148 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +148 -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 +2697 -0
- data/doc/monitor.html +435 -0
- data/doc/top-level-namespace.html +114 -0
- metadata +53 -1
data/doc/Stream.html
ADDED
@@ -0,0 +1,1401 @@
|
|
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: Stream
|
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#!Stream.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 (S)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">Stream</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: Stream
|
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">Stream</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/cw/stream.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
107
|
+
<ul class="summary">
|
108
|
+
|
109
|
+
<li class="public ">
|
110
|
+
<span class="summary_signature">
|
111
|
+
|
112
|
+
<a href="#active_region-instance_method" title="#active_region (instance method)">- (Object) <strong>active_region</strong> </a>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
</span>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<span class="summary_desc"><div class='inline'>
|
130
|
+
<p>Returns the value of attribute active_region.</p>
|
131
|
+
</div></span>
|
132
|
+
|
133
|
+
</li>
|
134
|
+
|
135
|
+
|
136
|
+
</ul>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<h2>
|
143
|
+
Instance Method Summary
|
144
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
145
|
+
</h2>
|
146
|
+
|
147
|
+
<ul class="summary">
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
152
|
+
<a href="#add_char-instance_method" title="#add_char (instance method)">- (Object) <strong>add_char</strong>(char) </a>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</span>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
167
|
+
|
168
|
+
</li>
|
169
|
+
|
170
|
+
|
171
|
+
<li class="public ">
|
172
|
+
<span class="summary_signature">
|
173
|
+
|
174
|
+
<a href="#add_word-instance_method" title="#add_word (instance method)">- (Object) <strong>add_word</strong>(word) </a>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
</span>
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
189
|
+
|
190
|
+
</li>
|
191
|
+
|
192
|
+
|
193
|
+
<li class="public ">
|
194
|
+
<span class="summary_signature">
|
195
|
+
|
196
|
+
<a href="#count-instance_method" title="#count (instance method)">- (Object) <strong>count</strong> </a>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
211
|
+
|
212
|
+
</li>
|
213
|
+
|
214
|
+
|
215
|
+
<li class="public ">
|
216
|
+
<span class="summary_signature">
|
217
|
+
|
218
|
+
<a href="#element-instance_method" title="#element (instance method)">- (Object) <strong>element</strong>(type) </a>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
</span>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
233
|
+
|
234
|
+
</li>
|
235
|
+
|
236
|
+
|
237
|
+
<li class="public ">
|
238
|
+
<span class="summary_signature">
|
239
|
+
|
240
|
+
<a href="#empty-instance_method" title="#empty (instance method)">- (Object) <strong>empty</strong> </a>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
</span>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
255
|
+
|
256
|
+
</li>
|
257
|
+
|
258
|
+
|
259
|
+
<li class="public ">
|
260
|
+
<span class="summary_signature">
|
261
|
+
|
262
|
+
<a href="#fail_unmarked_inactive_elements-instance_method" title="#fail_unmarked_inactive_elements (instance method)">- (Object) <strong>fail_unmarked_inactive_elements</strong> </a>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
</span>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
277
|
+
|
278
|
+
</li>
|
279
|
+
|
280
|
+
|
281
|
+
<li class="public ">
|
282
|
+
<span class="summary_signature">
|
283
|
+
|
284
|
+
<a href="#first-instance_method" title="#first (instance method)">- (Object) <strong>first</strong> </a>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
</span>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
299
|
+
|
300
|
+
</li>
|
301
|
+
|
302
|
+
|
303
|
+
<li class="public ">
|
304
|
+
<span class="summary_signature">
|
305
|
+
|
306
|
+
<a href="#inactive_region-instance_method" title="#inactive_region (instance method)">- (Object) <strong>inactive_region</strong> </a>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
</span>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
321
|
+
|
322
|
+
</li>
|
323
|
+
|
324
|
+
|
325
|
+
<li class="public ">
|
326
|
+
<span class="summary_signature">
|
327
|
+
|
328
|
+
<a href="#inc_first_element-instance_method" title="#inc_first_element (instance method)">- (Object) <strong>inc_first_element</strong> </a>
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
</span>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
343
|
+
|
344
|
+
</li>
|
345
|
+
|
346
|
+
|
347
|
+
<li class="public ">
|
348
|
+
<span class="summary_signature">
|
349
|
+
|
350
|
+
<a href="#inc_last_element-instance_method" title="#inc_last_element (instance method)">- (Object) <strong>inc_last_element</strong> </a>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
</span>
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
365
|
+
|
366
|
+
</li>
|
367
|
+
|
368
|
+
|
369
|
+
<li class="public ">
|
370
|
+
<span class="summary_signature">
|
371
|
+
|
372
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Stream) <strong>initialize</strong> </a>
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
</span>
|
377
|
+
|
378
|
+
|
379
|
+
<span class="note title constructor">constructor</span>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
<span class="summary_desc"><div class='inline'>
|
389
|
+
<p>A new instance of Stream.</p>
|
390
|
+
</div></span>
|
391
|
+
|
392
|
+
</li>
|
393
|
+
|
394
|
+
|
395
|
+
<li class="public ">
|
396
|
+
<span class="summary_signature">
|
397
|
+
|
398
|
+
<a href="#mark-instance_method" title="#mark (instance method)">- (Object) <strong>mark</strong>(element, type) </a>
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
</span>
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
413
|
+
|
414
|
+
</li>
|
415
|
+
|
416
|
+
|
417
|
+
<li class="public ">
|
418
|
+
<span class="summary_signature">
|
419
|
+
|
420
|
+
<a href="#mark_fail-instance_method" title="#mark_fail (instance method)">- (Object) <strong>mark_fail</strong>(element) </a>
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
</span>
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
435
|
+
|
436
|
+
</li>
|
437
|
+
|
438
|
+
|
439
|
+
<li class="public ">
|
440
|
+
<span class="summary_signature">
|
441
|
+
|
442
|
+
<a href="#mark_success-instance_method" title="#mark_success (instance method)">- (Object) <strong>mark_success</strong>(element) </a>
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
</span>
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
457
|
+
|
458
|
+
</li>
|
459
|
+
|
460
|
+
|
461
|
+
<li class="public ">
|
462
|
+
<span class="summary_signature">
|
463
|
+
|
464
|
+
<a href="#match_first_active_element-instance_method" title="#match_first_active_element (instance method)">- (Object) <strong>match_first_active_element</strong>(match) </a>
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
</span>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
479
|
+
|
480
|
+
</li>
|
481
|
+
|
482
|
+
|
483
|
+
<li class="public ">
|
484
|
+
<span class="summary_signature">
|
485
|
+
|
486
|
+
<a href="#match_last_active_element-instance_method" title="#match_last_active_element (instance method)">- (Object) <strong>match_last_active_element</strong>(match) </a>
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
</span>
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
|
500
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
501
|
+
|
502
|
+
</li>
|
503
|
+
|
504
|
+
|
505
|
+
<li class="public ">
|
506
|
+
<span class="summary_signature">
|
507
|
+
|
508
|
+
<a href="#pop-instance_method" title="#pop (instance method)">- (Object) <strong>pop</strong> </a>
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
</span>
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
|
522
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
523
|
+
|
524
|
+
</li>
|
525
|
+
|
526
|
+
|
527
|
+
<li class="public ">
|
528
|
+
<span class="summary_signature">
|
529
|
+
|
530
|
+
<a href="#pop_next_marked-instance_method" title="#pop_next_marked (instance method)">- (Object) <strong>pop_next_marked</strong> </a>
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
</span>
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
<span class="summary_desc"><div class='inline'>
|
545
|
+
<p>def pop_marked return_val = {} fail_unmarked_inactive_elements
|
546
|
+
@first_element.upto(@last_element) do |ele| unless stream_empty?
|
547
|
+
if(ele @<a href="ele">success</a>} <a href="ele">elsif(@success</a>
|
548
|
+
== true || @<a href="ele">success</a> == false) <a
|
549
|
+
href="ele">return_val</a> = => @<a href="ele">success</a>
|
550
|
+
else break end end end return_val == {} ? nil :
|
551
|
+
return_val end.</p>
|
552
|
+
</div></span>
|
553
|
+
|
554
|
+
</li>
|
555
|
+
|
556
|
+
|
557
|
+
<li class="public ">
|
558
|
+
<span class="summary_signature">
|
559
|
+
|
560
|
+
<a href="#stream_empty%3F-instance_method" title="#stream_empty? (instance method)">- (Boolean) <strong>stream_empty?</strong> </a>
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
</span>
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
575
|
+
|
576
|
+
</li>
|
577
|
+
|
578
|
+
|
579
|
+
</ul>
|
580
|
+
|
581
|
+
|
582
|
+
<div id="constructor_details" class="method_details_list">
|
583
|
+
<h2>Constructor Details</h2>
|
584
|
+
|
585
|
+
<div class="method_details first">
|
586
|
+
<h3 class="signature first" id="initialize-instance_method">
|
587
|
+
|
588
|
+
- (<tt><span class='object_link'><a href="" title="Stream (class)">Stream</a></span></tt>) <strong>initialize</strong>
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
</h3><div class="docstring">
|
595
|
+
<div class="discussion">
|
596
|
+
|
597
|
+
<p>Returns a new instance of Stream</p>
|
598
|
+
|
599
|
+
|
600
|
+
</div>
|
601
|
+
</div>
|
602
|
+
<div class="tags">
|
603
|
+
|
604
|
+
|
605
|
+
</div><table class="source_code">
|
606
|
+
<tr>
|
607
|
+
<td>
|
608
|
+
<pre class="lines">
|
609
|
+
|
610
|
+
|
611
|
+
7
|
612
|
+
8
|
613
|
+
9
|
614
|
+
10</pre>
|
615
|
+
</td>
|
616
|
+
<td>
|
617
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 7</span>
|
618
|
+
|
619
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
620
|
+
<span class='ivar'>@active_region</span> <span class='op'>=</span> <span class='int'>6</span>
|
621
|
+
<span class='id identifier rubyid_empty'>empty</span>
|
622
|
+
<span class='kw'>end</span></pre>
|
623
|
+
</td>
|
624
|
+
</tr>
|
625
|
+
</table>
|
626
|
+
</div>
|
627
|
+
|
628
|
+
</div>
|
629
|
+
|
630
|
+
<div id="instance_attr_details" class="attr_details">
|
631
|
+
<h2>Instance Attribute Details</h2>
|
632
|
+
|
633
|
+
|
634
|
+
<span id="active_region=-instance_method"></span>
|
635
|
+
<div class="method_details first">
|
636
|
+
<h3 class="signature first" id="active_region-instance_method">
|
637
|
+
|
638
|
+
- (<tt>Object</tt>) <strong>active_region</strong>
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
</h3><div class="docstring">
|
645
|
+
<div class="discussion">
|
646
|
+
|
647
|
+
<p>Returns the value of attribute active_region</p>
|
648
|
+
|
649
|
+
|
650
|
+
</div>
|
651
|
+
</div>
|
652
|
+
<div class="tags">
|
653
|
+
|
654
|
+
|
655
|
+
</div><table class="source_code">
|
656
|
+
<tr>
|
657
|
+
<td>
|
658
|
+
<pre class="lines">
|
659
|
+
|
660
|
+
|
661
|
+
5
|
662
|
+
6
|
663
|
+
7</pre>
|
664
|
+
</td>
|
665
|
+
<td>
|
666
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 5</span>
|
667
|
+
|
668
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_active_region'>active_region</span>
|
669
|
+
<span class='ivar'>@active_region</span>
|
670
|
+
<span class='kw'>end</span></pre>
|
671
|
+
</td>
|
672
|
+
</tr>
|
673
|
+
</table>
|
674
|
+
</div>
|
675
|
+
|
676
|
+
</div>
|
677
|
+
|
678
|
+
|
679
|
+
<div id="instance_method_details" class="method_details_list">
|
680
|
+
<h2>Instance Method Details</h2>
|
681
|
+
|
682
|
+
|
683
|
+
<div class="method_details first">
|
684
|
+
<h3 class="signature first" id="add_char-instance_method">
|
685
|
+
|
686
|
+
- (<tt>Object</tt>) <strong>add_char</strong>(char)
|
687
|
+
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
|
692
|
+
</h3><table class="source_code">
|
693
|
+
<tr>
|
694
|
+
<td>
|
695
|
+
<pre class="lines">
|
696
|
+
|
697
|
+
|
698
|
+
26
|
699
|
+
27
|
700
|
+
28
|
701
|
+
29
|
702
|
+
30</pre>
|
703
|
+
</td>
|
704
|
+
<td>
|
705
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 26</span>
|
706
|
+
|
707
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_char'>add_char</span> <span class='id identifier rubyid_char'>char</span>
|
708
|
+
<span class='ivar'>@stream</span><span class='lbracket'>[</span><span class='ivar'>@last_element</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_char'>char</span>
|
709
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='ivar'>@last_element</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
710
|
+
<span class='id identifier rubyid_inc_last_element'>inc_last_element</span>
|
711
|
+
<span class='kw'>end</span></pre>
|
712
|
+
</td>
|
713
|
+
</tr>
|
714
|
+
</table>
|
715
|
+
</div>
|
716
|
+
|
717
|
+
<div class="method_details ">
|
718
|
+
<h3 class="signature " id="add_word-instance_method">
|
719
|
+
|
720
|
+
- (<tt>Object</tt>) <strong>add_word</strong>(word)
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
|
726
|
+
</h3><table class="source_code">
|
727
|
+
<tr>
|
728
|
+
<td>
|
729
|
+
<pre class="lines">
|
730
|
+
|
731
|
+
|
732
|
+
20
|
733
|
+
21
|
734
|
+
22
|
735
|
+
23
|
736
|
+
24</pre>
|
737
|
+
</td>
|
738
|
+
<td>
|
739
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 20</span>
|
740
|
+
|
741
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_word'>add_word</span> <span class='id identifier rubyid_word'>word</span>
|
742
|
+
<span class='ivar'>@stream</span><span class='lbracket'>[</span><span class='ivar'>@last_element</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_word'>word</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
|
743
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='ivar'>@last_element</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
744
|
+
<span class='id identifier rubyid_inc_last_element'>inc_last_element</span>
|
745
|
+
<span class='kw'>end</span></pre>
|
746
|
+
</td>
|
747
|
+
</tr>
|
748
|
+
</table>
|
749
|
+
</div>
|
750
|
+
|
751
|
+
<div class="method_details ">
|
752
|
+
<h3 class="signature " id="count-instance_method">
|
753
|
+
|
754
|
+
- (<tt>Object</tt>) <strong>count</strong>
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
</h3><table class="source_code">
|
761
|
+
<tr>
|
762
|
+
<td>
|
763
|
+
<pre class="lines">
|
764
|
+
|
765
|
+
|
766
|
+
16
|
767
|
+
17
|
768
|
+
18</pre>
|
769
|
+
</td>
|
770
|
+
<td>
|
771
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 16</span>
|
772
|
+
|
773
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_count'>count</span>
|
774
|
+
<span class='ivar'>@last_element</span> <span class='op'>-</span> <span class='ivar'>@first_element</span>
|
775
|
+
<span class='kw'>end</span></pre>
|
776
|
+
</td>
|
777
|
+
</tr>
|
778
|
+
</table>
|
779
|
+
</div>
|
780
|
+
|
781
|
+
<div class="method_details ">
|
782
|
+
<h3 class="signature " id="element-instance_method">
|
783
|
+
|
784
|
+
- (<tt>Object</tt>) <strong>element</strong>(type)
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
|
789
|
+
|
790
|
+
</h3><table class="source_code">
|
791
|
+
<tr>
|
792
|
+
<td>
|
793
|
+
<pre class="lines">
|
794
|
+
|
795
|
+
|
796
|
+
118
|
797
|
+
119
|
798
|
+
120
|
799
|
+
121
|
800
|
+
122</pre>
|
801
|
+
</td>
|
802
|
+
<td>
|
803
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 118</span>
|
804
|
+
|
805
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_element'>element</span> <span class='id identifier rubyid_type'>type</span>
|
806
|
+
<span class='kw'>return</span> <span class='ivar'>@last_element</span> <span class='op'>-</span> <span class='int'>1</span> <span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:last</span>
|
807
|
+
<span class='id identifier rubyid_first'>first</span> <span class='op'>=</span> <span class='ivar'>@last_element</span> <span class='op'>-</span> <span class='ivar'>@active_region</span> <span class='op'>-</span> <span class='int'>1</span>
|
808
|
+
<span class='id identifier rubyid_first'>first</span> <span class='op'><</span> <span class='int'>0</span> <span class='op'>?</span> <span class='int'>0</span> <span class='op'>:</span> <span class='id identifier rubyid_first'>first</span>
|
809
|
+
<span class='kw'>end</span></pre>
|
810
|
+
</td>
|
811
|
+
</tr>
|
812
|
+
</table>
|
813
|
+
</div>
|
814
|
+
|
815
|
+
<div class="method_details ">
|
816
|
+
<h3 class="signature " id="empty-instance_method">
|
817
|
+
|
818
|
+
- (<tt>Object</tt>) <strong>empty</strong>
|
819
|
+
|
820
|
+
|
821
|
+
|
822
|
+
|
823
|
+
|
824
|
+
</h3><table class="source_code">
|
825
|
+
<tr>
|
826
|
+
<td>
|
827
|
+
<pre class="lines">
|
828
|
+
|
829
|
+
|
830
|
+
12
|
831
|
+
13
|
832
|
+
14</pre>
|
833
|
+
</td>
|
834
|
+
<td>
|
835
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 12</span>
|
836
|
+
|
837
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_empty'>empty</span>
|
838
|
+
<span class='ivar'>@stream</span><span class='comma'>,</span> <span class='ivar'>@success</span><span class='comma'>,</span> <span class='ivar'>@first_element</span><span class='comma'>,</span> <span class='ivar'>@last_element</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span>
|
839
|
+
<span class='kw'>end</span></pre>
|
840
|
+
</td>
|
841
|
+
</tr>
|
842
|
+
</table>
|
843
|
+
</div>
|
844
|
+
|
845
|
+
<div class="method_details ">
|
846
|
+
<h3 class="signature " id="fail_unmarked_inactive_elements-instance_method">
|
847
|
+
|
848
|
+
- (<tt>Object</tt>) <strong>fail_unmarked_inactive_elements</strong>
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
|
854
|
+
</h3><table class="source_code">
|
855
|
+
<tr>
|
856
|
+
<td>
|
857
|
+
<pre class="lines">
|
858
|
+
|
859
|
+
|
860
|
+
60
|
861
|
+
61
|
862
|
+
62
|
863
|
+
63
|
864
|
+
64
|
865
|
+
65
|
866
|
+
66</pre>
|
867
|
+
</td>
|
868
|
+
<td>
|
869
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 60</span>
|
870
|
+
|
871
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fail_unmarked_inactive_elements'>fail_unmarked_inactive_elements</span>
|
872
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='lparen'>(</span> <span class='op'>!</span> <span class='id identifier rubyid_stream_empty?'>stream_empty?</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_count'>count</span> <span class='op'>></span> <span class='ivar'>@active_region</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
873
|
+
<span class='ivar'>@first_element</span><span class='period'>.</span><span class='id identifier rubyid_upto'>upto</span><span class='lparen'>(</span><span class='id identifier rubyid_inactive_region'>inactive_region</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_count'>count</span><span class='op'>|</span>
|
874
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_count'>count</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_count'>count</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span>
|
875
|
+
<span class='kw'>end</span>
|
876
|
+
<span class='kw'>end</span>
|
877
|
+
<span class='kw'>end</span></pre>
|
878
|
+
</td>
|
879
|
+
</tr>
|
880
|
+
</table>
|
881
|
+
</div>
|
882
|
+
|
883
|
+
<div class="method_details ">
|
884
|
+
<h3 class="signature " id="first-instance_method">
|
885
|
+
|
886
|
+
- (<tt>Object</tt>) <strong>first</strong>
|
887
|
+
|
888
|
+
|
889
|
+
|
890
|
+
|
891
|
+
|
892
|
+
</h3><table class="source_code">
|
893
|
+
<tr>
|
894
|
+
<td>
|
895
|
+
<pre class="lines">
|
896
|
+
|
897
|
+
|
898
|
+
68
|
899
|
+
69
|
900
|
+
70</pre>
|
901
|
+
</td>
|
902
|
+
<td>
|
903
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 68</span>
|
904
|
+
|
905
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_first'>first</span>
|
906
|
+
<span class='ivar'>@stream</span><span class='lbracket'>[</span><span class='ivar'>@first_element</span><span class='rbracket'>]</span>
|
907
|
+
<span class='kw'>end</span></pre>
|
908
|
+
</td>
|
909
|
+
</tr>
|
910
|
+
</table>
|
911
|
+
</div>
|
912
|
+
|
913
|
+
<div class="method_details ">
|
914
|
+
<h3 class="signature " id="inactive_region-instance_method">
|
915
|
+
|
916
|
+
- (<tt>Object</tt>) <strong>inactive_region</strong>
|
917
|
+
|
918
|
+
|
919
|
+
|
920
|
+
|
921
|
+
|
922
|
+
</h3><table class="source_code">
|
923
|
+
<tr>
|
924
|
+
<td>
|
925
|
+
<pre class="lines">
|
926
|
+
|
927
|
+
|
928
|
+
56
|
929
|
+
57
|
930
|
+
58</pre>
|
931
|
+
</td>
|
932
|
+
<td>
|
933
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 56</span>
|
934
|
+
|
935
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_inactive_region'>inactive_region</span>
|
936
|
+
<span class='id identifier rubyid_stream_empty?'>stream_empty?</span> <span class='op'>?</span> <span class='kw'>nil</span> <span class='op'>:</span> <span class='ivar'>@last_element</span> <span class='op'>-</span> <span class='ivar'>@active_region</span> <span class='op'>-</span> <span class='int'>1</span>
|
937
|
+
<span class='kw'>end</span></pre>
|
938
|
+
</td>
|
939
|
+
</tr>
|
940
|
+
</table>
|
941
|
+
</div>
|
942
|
+
|
943
|
+
<div class="method_details ">
|
944
|
+
<h3 class="signature " id="inc_first_element-instance_method">
|
945
|
+
|
946
|
+
- (<tt>Object</tt>) <strong>inc_first_element</strong>
|
947
|
+
|
948
|
+
|
949
|
+
|
950
|
+
|
951
|
+
|
952
|
+
</h3><table class="source_code">
|
953
|
+
<tr>
|
954
|
+
<td>
|
955
|
+
<pre class="lines">
|
956
|
+
|
957
|
+
|
958
|
+
36
|
959
|
+
37
|
960
|
+
38</pre>
|
961
|
+
</td>
|
962
|
+
<td>
|
963
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 36</span>
|
964
|
+
|
965
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_inc_first_element'>inc_first_element</span>
|
966
|
+
<span class='ivar'>@first_element</span> <span class='op'>+=</span> <span class='int'>1</span>
|
967
|
+
<span class='kw'>end</span></pre>
|
968
|
+
</td>
|
969
|
+
</tr>
|
970
|
+
</table>
|
971
|
+
</div>
|
972
|
+
|
973
|
+
<div class="method_details ">
|
974
|
+
<h3 class="signature " id="inc_last_element-instance_method">
|
975
|
+
|
976
|
+
- (<tt>Object</tt>) <strong>inc_last_element</strong>
|
977
|
+
|
978
|
+
|
979
|
+
|
980
|
+
|
981
|
+
|
982
|
+
</h3><table class="source_code">
|
983
|
+
<tr>
|
984
|
+
<td>
|
985
|
+
<pre class="lines">
|
986
|
+
|
987
|
+
|
988
|
+
32
|
989
|
+
33
|
990
|
+
34</pre>
|
991
|
+
</td>
|
992
|
+
<td>
|
993
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 32</span>
|
994
|
+
|
995
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_inc_last_element'>inc_last_element</span>
|
996
|
+
<span class='ivar'>@last_element</span> <span class='op'>+=</span> <span class='int'>1</span>
|
997
|
+
<span class='kw'>end</span></pre>
|
998
|
+
</td>
|
999
|
+
</tr>
|
1000
|
+
</table>
|
1001
|
+
</div>
|
1002
|
+
|
1003
|
+
<div class="method_details ">
|
1004
|
+
<h3 class="signature " id="mark-instance_method">
|
1005
|
+
|
1006
|
+
- (<tt>Object</tt>) <strong>mark</strong>(element, type)
|
1007
|
+
|
1008
|
+
|
1009
|
+
|
1010
|
+
|
1011
|
+
|
1012
|
+
</h3><table class="source_code">
|
1013
|
+
<tr>
|
1014
|
+
<td>
|
1015
|
+
<pre class="lines">
|
1016
|
+
|
1017
|
+
|
1018
|
+
40
|
1019
|
+
41
|
1020
|
+
42</pre>
|
1021
|
+
</td>
|
1022
|
+
<td>
|
1023
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 40</span>
|
1024
|
+
|
1025
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mark'>mark</span><span class='lparen'>(</span><span class='id identifier rubyid_element'>element</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
1026
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_element'>element</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span>
|
1027
|
+
<span class='kw'>end</span></pre>
|
1028
|
+
</td>
|
1029
|
+
</tr>
|
1030
|
+
</table>
|
1031
|
+
</div>
|
1032
|
+
|
1033
|
+
<div class="method_details ">
|
1034
|
+
<h3 class="signature " id="mark_fail-instance_method">
|
1035
|
+
|
1036
|
+
- (<tt>Object</tt>) <strong>mark_fail</strong>(element)
|
1037
|
+
|
1038
|
+
|
1039
|
+
|
1040
|
+
|
1041
|
+
|
1042
|
+
</h3><table class="source_code">
|
1043
|
+
<tr>
|
1044
|
+
<td>
|
1045
|
+
<pre class="lines">
|
1046
|
+
|
1047
|
+
|
1048
|
+
48
|
1049
|
+
49
|
1050
|
+
50</pre>
|
1051
|
+
</td>
|
1052
|
+
<td>
|
1053
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 48</span>
|
1054
|
+
|
1055
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mark_fail'>mark_fail</span> <span class='id identifier rubyid_element'>element</span>
|
1056
|
+
<span class='id identifier rubyid_mark'>mark</span> <span class='id identifier rubyid_element'>element</span><span class='comma'>,</span> <span class='kw'>false</span>
|
1057
|
+
<span class='kw'>end</span></pre>
|
1058
|
+
</td>
|
1059
|
+
</tr>
|
1060
|
+
</table>
|
1061
|
+
</div>
|
1062
|
+
|
1063
|
+
<div class="method_details ">
|
1064
|
+
<h3 class="signature " id="mark_success-instance_method">
|
1065
|
+
|
1066
|
+
- (<tt>Object</tt>) <strong>mark_success</strong>(element)
|
1067
|
+
|
1068
|
+
|
1069
|
+
|
1070
|
+
|
1071
|
+
|
1072
|
+
</h3><table class="source_code">
|
1073
|
+
<tr>
|
1074
|
+
<td>
|
1075
|
+
<pre class="lines">
|
1076
|
+
|
1077
|
+
|
1078
|
+
44
|
1079
|
+
45
|
1080
|
+
46</pre>
|
1081
|
+
</td>
|
1082
|
+
<td>
|
1083
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 44</span>
|
1084
|
+
|
1085
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mark_success'>mark_success</span> <span class='id identifier rubyid_element'>element</span>
|
1086
|
+
<span class='id identifier rubyid_mark'>mark</span> <span class='id identifier rubyid_element'>element</span><span class='comma'>,</span> <span class='kw'>true</span>
|
1087
|
+
<span class='kw'>end</span></pre>
|
1088
|
+
</td>
|
1089
|
+
</tr>
|
1090
|
+
</table>
|
1091
|
+
</div>
|
1092
|
+
|
1093
|
+
<div class="method_details ">
|
1094
|
+
<h3 class="signature " id="match_first_active_element-instance_method">
|
1095
|
+
|
1096
|
+
- (<tt>Object</tt>) <strong>match_first_active_element</strong>(match)
|
1097
|
+
|
1098
|
+
|
1099
|
+
|
1100
|
+
|
1101
|
+
|
1102
|
+
</h3><table class="source_code">
|
1103
|
+
<tr>
|
1104
|
+
<td>
|
1105
|
+
<pre class="lines">
|
1106
|
+
|
1107
|
+
|
1108
|
+
124
|
1109
|
+
125
|
1110
|
+
126
|
1111
|
+
127
|
1112
|
+
128
|
1113
|
+
129
|
1114
|
+
130
|
1115
|
+
131
|
1116
|
+
132
|
1117
|
+
133
|
1118
|
+
134
|
1119
|
+
135
|
1120
|
+
136
|
1121
|
+
137
|
1122
|
+
138
|
1123
|
+
139
|
1124
|
+
140
|
1125
|
+
141</pre>
|
1126
|
+
</td>
|
1127
|
+
<td>
|
1128
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 124</span>
|
1129
|
+
|
1130
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_match_first_active_element'>match_first_active_element</span> <span class='id identifier rubyid_match'>match</span>
|
1131
|
+
<span class='kw'>if</span> <span class='op'>!</span> <span class='id identifier rubyid_stream_empty?'>stream_empty?</span>
|
1132
|
+
<span class='id identifier rubyid_found'>found</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1133
|
+
<span class='id identifier rubyid_first'>first</span> <span class='op'>=</span> <span class='id identifier rubyid_element'>element</span><span class='lparen'>(</span><span class='symbol'>:first</span><span class='rparen'>)</span>
|
1134
|
+
<span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_upto'>upto</span> <span class='id identifier rubyid_element'>element</span><span class='lparen'>(</span><span class='symbol'>:last</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ele'>ele</span><span class='op'>|</span>
|
1135
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_found'>found</span>
|
1136
|
+
<span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_upto'>upto</span> <span class='id identifier rubyid_found'>found</span> <span class='op'>-</span> <span class='int'>1</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_failed'>failed</span><span class='op'>|</span>
|
1137
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_failed'>failed</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='comment'># unless @success[ele]
|
1138
|
+
</span> <span class='kw'>end</span>
|
1139
|
+
<span class='kw'>break</span>
|
1140
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@stream</span><span class='lbracket'>[</span><span class='id identifier rubyid_ele'>ele</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_match'>match</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='op'>!</span> <span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_ele'>ele</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1141
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_ele'>ele</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_found'>found</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_ele'>ele</span>
|
1142
|
+
<span class='kw'>else</span>
|
1143
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_first'>first</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1144
|
+
<span class='kw'>end</span>
|
1145
|
+
<span class='kw'>end</span>
|
1146
|
+
<span class='kw'>end</span>
|
1147
|
+
<span class='kw'>end</span></pre>
|
1148
|
+
</td>
|
1149
|
+
</tr>
|
1150
|
+
</table>
|
1151
|
+
</div>
|
1152
|
+
|
1153
|
+
<div class="method_details ">
|
1154
|
+
<h3 class="signature " id="match_last_active_element-instance_method">
|
1155
|
+
|
1156
|
+
- (<tt>Object</tt>) <strong>match_last_active_element</strong>(match)
|
1157
|
+
|
1158
|
+
|
1159
|
+
|
1160
|
+
|
1161
|
+
|
1162
|
+
</h3><table class="source_code">
|
1163
|
+
<tr>
|
1164
|
+
<td>
|
1165
|
+
<pre class="lines">
|
1166
|
+
|
1167
|
+
|
1168
|
+
143
|
1169
|
+
144
|
1170
|
+
145
|
1171
|
+
146
|
1172
|
+
147
|
1173
|
+
148
|
1174
|
+
149
|
1175
|
+
150
|
1176
|
+
151
|
1177
|
+
152
|
1178
|
+
153
|
1179
|
+
154
|
1180
|
+
155
|
1181
|
+
156
|
1182
|
+
157
|
1183
|
+
158
|
1184
|
+
159</pre>
|
1185
|
+
</td>
|
1186
|
+
<td>
|
1187
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 143</span>
|
1188
|
+
|
1189
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_match_last_active_element'>match_last_active_element</span> <span class='id identifier rubyid_match'>match</span>
|
1190
|
+
<span class='kw'>if</span> <span class='op'>!</span> <span class='id identifier rubyid_stream_empty?'>stream_empty?</span>
|
1191
|
+
<span class='id identifier rubyid_first'>first</span> <span class='op'>=</span> <span class='ivar'>@last_element</span> <span class='op'>-</span> <span class='ivar'>@active_region</span> <span class='op'>-</span> <span class='int'>1</span>
|
1192
|
+
<span class='id identifier rubyid_first'>first</span> <span class='op'>=</span> <span class='int'>0</span> <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_first'>first</span> <span class='op'><</span> <span class='int'>0</span><span class='rparen'>)</span>
|
1193
|
+
<span class='id identifier rubyid_last'>last</span> <span class='op'>=</span> <span class='ivar'>@last_element</span> <span class='op'>-</span> <span class='int'>1</span>
|
1194
|
+
<span class='id identifier rubyid_found'>found</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1195
|
+
<span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_downto'>downto</span><span class='lparen'>(</span><span class='id identifier rubyid_first'>first</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ele'>ele</span><span class='op'>|</span>
|
1196
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_found'>found</span>
|
1197
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_ele'>ele</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_ele'>ele</span><span class='rbracket'>]</span>
|
1198
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@stream</span><span class='lbracket'>[</span><span class='id identifier rubyid_ele'>ele</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_match'>match</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='op'>!</span> <span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_ele'>ele</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1199
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_ele'>ele</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_found'>found</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span>
|
1200
|
+
<span class='kw'>else</span>
|
1201
|
+
<span class='ivar'>@success</span><span class='lbracket'>[</span><span class='id identifier rubyid_first'>first</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1202
|
+
<span class='kw'>end</span>
|
1203
|
+
<span class='kw'>end</span>
|
1204
|
+
<span class='kw'>end</span>
|
1205
|
+
<span class='kw'>end</span></pre>
|
1206
|
+
</td>
|
1207
|
+
</tr>
|
1208
|
+
</table>
|
1209
|
+
</div>
|
1210
|
+
|
1211
|
+
<div class="method_details ">
|
1212
|
+
<h3 class="signature " id="pop-instance_method">
|
1213
|
+
|
1214
|
+
- (<tt>Object</tt>) <strong>pop</strong>
|
1215
|
+
|
1216
|
+
|
1217
|
+
|
1218
|
+
|
1219
|
+
|
1220
|
+
</h3><table class="source_code">
|
1221
|
+
<tr>
|
1222
|
+
<td>
|
1223
|
+
<pre class="lines">
|
1224
|
+
|
1225
|
+
|
1226
|
+
72
|
1227
|
+
73
|
1228
|
+
74
|
1229
|
+
75
|
1230
|
+
76
|
1231
|
+
77
|
1232
|
+
78
|
1233
|
+
79
|
1234
|
+
80
|
1235
|
+
81
|
1236
|
+
82
|
1237
|
+
83
|
1238
|
+
84</pre>
|
1239
|
+
</td>
|
1240
|
+
<td>
|
1241
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 72</span>
|
1242
|
+
|
1243
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pop'>pop</span>
|
1244
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_stream_empty?'>stream_empty?</span>
|
1245
|
+
<span class='id identifier rubyid_ele'>ele</span> <span class='op'>=</span> <span class='ivar'>@first_element</span>
|
1246
|
+
<span class='id identifier rubyid_inc_first_element'>inc_first_element</span>
|
1247
|
+
<span class='id identifier rubyid_success'>success</span> <span class='op'>=</span> <span class='ivar'>@success</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_ele'>ele</span><span class='rparen'>)</span>
|
1248
|
+
<span class='id identifier rubyid_success'>success</span> <span class='op'>=</span> <span class='id identifier rubyid_success'>success</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='op'>?</span> <span class='kw'>false</span> <span class='op'>:</span> <span class='id identifier rubyid_success'>success</span>
|
1249
|
+
<span class='lbrace'>{</span> <span class='symbol'>:value</span> <span class='op'>=></span> <span class='ivar'>@stream</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_ele'>ele</span><span class='rparen'>)</span><span class='comma'>,</span>
|
1250
|
+
<span class='symbol'>:success</span> <span class='op'>=></span> <span class='id identifier rubyid_success'>success</span>
|
1251
|
+
<span class='rbrace'>}</span>
|
1252
|
+
<span class='kw'>else</span>
|
1253
|
+
<span class='kw'>nil</span>
|
1254
|
+
<span class='kw'>end</span>
|
1255
|
+
<span class='kw'>end</span></pre>
|
1256
|
+
</td>
|
1257
|
+
</tr>
|
1258
|
+
</table>
|
1259
|
+
</div>
|
1260
|
+
|
1261
|
+
<div class="method_details ">
|
1262
|
+
<h3 class="signature " id="pop_next_marked-instance_method">
|
1263
|
+
|
1264
|
+
- (<tt>Object</tt>) <strong>pop_next_marked</strong>
|
1265
|
+
|
1266
|
+
|
1267
|
+
|
1268
|
+
|
1269
|
+
|
1270
|
+
</h3><div class="docstring">
|
1271
|
+
<div class="discussion">
|
1272
|
+
|
1273
|
+
<p>def pop_marked</p>
|
1274
|
+
|
1275
|
+
<pre class="code ruby"><code class="ruby"> return_val = {}
|
1276
|
+
fail_unmarked_inactive_elements
|
1277
|
+
@first_element.upto(@last_element) do |ele|
|
1278
|
+
unless stream_empty?
|
1279
|
+
if(ele < inactive_region)
|
1280
|
+
val = pop
|
1281
|
+
|
1282
|
+
return_val[ele] = {pop => @success[ele]}
|
1283
|
+
elsif(@success[ele] == true || @success[ele] == false)
|
1284
|
+
return_val[ele] = {pop => @success[ele]}
|
1285
|
+
else
|
1286
|
+
break
|
1287
|
+
end
|
1288
|
+
end
|
1289
|
+
end
|
1290
|
+
return_val == {} ? nil : return_val
|
1291
|
+
end</code></pre>
|
1292
|
+
|
1293
|
+
|
1294
|
+
</div>
|
1295
|
+
</div>
|
1296
|
+
<div class="tags">
|
1297
|
+
|
1298
|
+
|
1299
|
+
</div><table class="source_code">
|
1300
|
+
<tr>
|
1301
|
+
<td>
|
1302
|
+
<pre class="lines">
|
1303
|
+
|
1304
|
+
|
1305
|
+
105
|
1306
|
+
106
|
1307
|
+
107
|
1308
|
+
108
|
1309
|
+
109
|
1310
|
+
110
|
1311
|
+
111
|
1312
|
+
112
|
1313
|
+
113
|
1314
|
+
114
|
1315
|
+
115
|
1316
|
+
116</pre>
|
1317
|
+
</td>
|
1318
|
+
<td>
|
1319
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 105</span>
|
1320
|
+
|
1321
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pop_next_marked'>pop_next_marked</span>
|
1322
|
+
<span class='id identifier rubyid_return_val'>return_val</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1323
|
+
<span class='id identifier rubyid_fail_unmarked_inactive_elements'>fail_unmarked_inactive_elements</span>
|
1324
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_stream_empty?'>stream_empty?</span>
|
1325
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='ivar'>@first_element</span> <span class='op'><</span> <span class='id identifier rubyid_inactive_region'>inactive_region</span><span class='rparen'>)</span>
|
1326
|
+
<span class='id identifier rubyid_pop'>pop</span>
|
1327
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='ivar'>@success</span><span class='lbracket'>[</span><span class='ivar'>@first_element</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span> <span class='op'>||</span> <span class='ivar'>@success</span><span class='lbracket'>[</span><span class='ivar'>@first_element</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
1328
|
+
<span class='id identifier rubyid_pop'>pop</span>
|
1329
|
+
<span class='kw'>end</span>
|
1330
|
+
<span class='kw'>end</span>
|
1331
|
+
<span class='comment'># return_val == {} ? nil : return_val
|
1332
|
+
</span><span class='kw'>end</span></pre>
|
1333
|
+
</td>
|
1334
|
+
</tr>
|
1335
|
+
</table>
|
1336
|
+
</div>
|
1337
|
+
|
1338
|
+
<div class="method_details ">
|
1339
|
+
<h3 class="signature " id="stream_empty?-instance_method">
|
1340
|
+
|
1341
|
+
- (<tt>Boolean</tt>) <strong>stream_empty?</strong>
|
1342
|
+
|
1343
|
+
|
1344
|
+
|
1345
|
+
|
1346
|
+
|
1347
|
+
</h3><div class="docstring">
|
1348
|
+
<div class="discussion">
|
1349
|
+
|
1350
|
+
|
1351
|
+
</div>
|
1352
|
+
</div>
|
1353
|
+
<div class="tags">
|
1354
|
+
|
1355
|
+
<p class="tag_title">Returns:</p>
|
1356
|
+
<ul class="return">
|
1357
|
+
|
1358
|
+
<li>
|
1359
|
+
|
1360
|
+
|
1361
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1362
|
+
|
1363
|
+
|
1364
|
+
|
1365
|
+
</li>
|
1366
|
+
|
1367
|
+
</ul>
|
1368
|
+
|
1369
|
+
</div><table class="source_code">
|
1370
|
+
<tr>
|
1371
|
+
<td>
|
1372
|
+
<pre class="lines">
|
1373
|
+
|
1374
|
+
|
1375
|
+
52
|
1376
|
+
53
|
1377
|
+
54</pre>
|
1378
|
+
</td>
|
1379
|
+
<td>
|
1380
|
+
<pre class="code"><span class="info file"># File 'lib/cw/stream.rb', line 52</span>
|
1381
|
+
|
1382
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_stream_empty?'>stream_empty?</span>
|
1383
|
+
<span class='ivar'>@first_element</span> <span class='op'>==</span> <span class='ivar'>@last_element</span>
|
1384
|
+
<span class='kw'>end</span></pre>
|
1385
|
+
</td>
|
1386
|
+
</tr>
|
1387
|
+
</table>
|
1388
|
+
</div>
|
1389
|
+
|
1390
|
+
</div>
|
1391
|
+
|
1392
|
+
</div>
|
1393
|
+
|
1394
|
+
<div id="footer">
|
1395
|
+
Generated on Mon May 23 21:20:17 2016 by
|
1396
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1397
|
+
0.8.7.6 (ruby-2.2.0).
|
1398
|
+
</div>
|
1399
|
+
|
1400
|
+
</body>
|
1401
|
+
</html>
|