imp 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1073 @@
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: Imp::Tree
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
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#!" + escape(window.location.href);
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 (T)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Imp.html" title="Imp (module)">Imp</a></span></span>
36
+ &raquo;
37
+ <span class="title">Tree</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: Imp::Tree
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">Imp::Tree</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r2">Includes:</dt>
94
+ <dd class="r2">Enumerable</dd>
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r1 last">Defined in:</dt>
101
+ <dd class="r1 last">lib/imp/tree.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>A directory-esque tree with labeled nodes and edges.</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div>
118
+
119
+
120
+
121
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#val-instance_method" title="#val (instance method)">- (Object) <strong>val</strong> </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ <span class="summary_desc"><div class='inline'>
145
+ <p>The value of the current node in the tree.</p>
146
+ </div></span>
147
+
148
+ </li>
149
+
150
+
151
+ </ul>
152
+
153
+
154
+
155
+
156
+
157
+ <h2>
158
+ Instance Method Summary
159
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
160
+ </h2>
161
+
162
+ <ul class="summary">
163
+
164
+ <li class="public ">
165
+ <span class="summary_signature">
166
+
167
+ <a href="#%5B%5D-instance_method" title="#[] (instance method)">- (Tree<sup>?</sup>) <strong>[]</strong>(key, create = false) </a>
168
+
169
+
170
+
171
+ </span>
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+ <span class="summary_desc"><div class='inline'>
182
+ <p>Gets a subtree by the label of the edge leading to it.</p>
183
+ </div></span>
184
+
185
+ </li>
186
+
187
+
188
+ <li class="public ">
189
+ <span class="summary_signature">
190
+
191
+ <a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(key) </a>
192
+
193
+
194
+
195
+ </span>
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+ <span class="summary_desc"><div class='inline'>
206
+ <p>Removes a subtree by the label of the edge leading to it.</p>
207
+ </div></span>
208
+
209
+ </li>
210
+
211
+
212
+ <li class="public ">
213
+ <span class="summary_signature">
214
+
215
+ <a href="#descendant-instance_method" title="#descendant (instance method)">- (Tree<sup>?</sup>) <strong>descendant</strong>(key, create = false) </a>
216
+
217
+
218
+
219
+ </span>
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+ <span class="summary_desc"><div class='inline'>
230
+ <p>Gets a (more distant descendant of the current node..</p>
231
+ </div></span>
232
+
233
+ </li>
234
+
235
+
236
+ <li class="public ">
237
+ <span class="summary_signature">
238
+
239
+ <a href="#each-instance_method" title="#each (instance method)">- (Object) <strong>each</strong> {|String, Tree| ... }</a>
240
+
241
+
242
+
243
+ </span>
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+ <span class="summary_desc"><div class='inline'>
254
+ <p>Iterates over (edge, node) pairs.</p>
255
+ </div></span>
256
+
257
+ </li>
258
+
259
+
260
+ <li class="public ">
261
+ <span class="summary_signature">
262
+
263
+ <a href="#include%3F-instance_method" title="#include? (instance method)">- (Boolean) <strong>include?</strong>(item) </a>
264
+
265
+
266
+
267
+ </span>
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+ <span class="summary_desc"><div class='inline'>
278
+ <p>Checks if an edge is included.</p>
279
+ </div></span>
280
+
281
+ </li>
282
+
283
+
284
+ <li class="public ">
285
+ <span class="summary_signature">
286
+
287
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Tree) <strong>initialize</strong>(val = nil) </a>
288
+
289
+
290
+
291
+ </span>
292
+
293
+
294
+ <span class="note title constructor">constructor</span>
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+ <span class="summary_desc"><div class='inline'>
304
+ <p>Creates a new Tree.</p>
305
+ </div></span>
306
+
307
+ </li>
308
+
309
+
310
+ <li class="public ">
311
+ <span class="summary_signature">
312
+
313
+ <a href="#leaf%3F-instance_method" title="#leaf? (instance method)">- (Boolean) <strong>leaf?</strong> </a>
314
+
315
+
316
+
317
+ </span>
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+ <span class="summary_desc"><div class='inline'>
328
+ <p>Checks if this is a leaf node.</p>
329
+ </div></span>
330
+
331
+ </li>
332
+
333
+
334
+ <li class="public ">
335
+ <span class="summary_signature">
336
+
337
+ <a href="#to_s-instance_method" title="#to_s (instance method)">- (String) <strong>to_s</strong>(indent = 0) </a>
338
+
339
+
340
+
341
+ </span>
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+ <span class="summary_desc"><div class='inline'>
352
+ <p>Prints the skeleton of the tree.</p>
353
+ </div></span>
354
+
355
+ </li>
356
+
357
+
358
+ </ul>
359
+
360
+
361
+
362
+ <div id="constructor_details" class="method_details_list">
363
+ <h2>Constructor Details</h2>
364
+
365
+ <div class="method_details first">
366
+ <h3 class="signature first" id="initialize-instance_method">
367
+
368
+ - (<tt><span class='object_link'><a href="" title="Imp::Tree (class)">Tree</a></span></tt>) <strong>initialize</strong>(val = nil)
369
+
370
+
371
+
372
+
373
+
374
+ </h3><div class="docstring">
375
+ <div class="discussion">
376
+
377
+ <p>Creates a new Tree.</p>
378
+
379
+
380
+ </div>
381
+ </div>
382
+ <div class="tags">
383
+ <p class="tag_title">Parameters:</p>
384
+ <ul class="param">
385
+
386
+ <li>
387
+
388
+ <span class='name'>val</span>
389
+
390
+
391
+ <span class='type'>(<tt>Object</tt>)</span>
392
+
393
+
394
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
395
+
396
+
397
+ &mdash;
398
+ <div class='inline'>
399
+ <p>The node label of the tree.</p>
400
+ </div>
401
+
402
+ </li>
403
+
404
+ </ul>
405
+
406
+
407
+ </div><table class="source_code">
408
+ <tr>
409
+ <td>
410
+ <pre class="lines">
411
+
412
+
413
+ 16
414
+ 17
415
+ 18
416
+ 19</pre>
417
+ </td>
418
+ <td>
419
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 16</span>
420
+
421
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
422
+ <span class='ivar'>@val</span> <span class='op'>=</span> <span class='id identifier rubyid_val'>val</span>
423
+ <span class='ivar'>@succ</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
424
+ <span class='kw'>end</span></pre>
425
+ </td>
426
+ </tr>
427
+ </table>
428
+ </div>
429
+
430
+ </div>
431
+
432
+ <div id="instance_attr_details" class="attr_details">
433
+ <h2>Instance Attribute Details</h2>
434
+
435
+
436
+ <span id="val=-instance_method"></span>
437
+ <div class="method_details first">
438
+ <h3 class="signature first" id="val-instance_method">
439
+
440
+ - (<tt>Object</tt>) <strong>val</strong>
441
+
442
+
443
+
444
+
445
+
446
+ </h3><div class="docstring">
447
+ <div class="discussion">
448
+
449
+ <p>The value of the current node in the tree.</p>
450
+
451
+
452
+ </div>
453
+ </div>
454
+ <div class="tags">
455
+
456
+
457
+ </div><table class="source_code">
458
+ <tr>
459
+ <td>
460
+ <pre class="lines">
461
+
462
+
463
+ 11
464
+ 12
465
+ 13</pre>
466
+ </td>
467
+ <td>
468
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 11</span>
469
+
470
+ <span class='kw'>def</span> <span class='id identifier rubyid_val'>val</span>
471
+ <span class='ivar'>@val</span>
472
+ <span class='kw'>end</span></pre>
473
+ </td>
474
+ </tr>
475
+ </table>
476
+ </div>
477
+
478
+ </div>
479
+
480
+
481
+ <div id="instance_method_details" class="method_details_list">
482
+ <h2>Instance Method Details</h2>
483
+
484
+
485
+ <div class="method_details first">
486
+ <h3 class="signature first" id="[]-instance_method">
487
+
488
+ - (<tt><span class='object_link'><a href="" title="Imp::Tree (class)">Tree</a></span></tt><sup>?</sup>) <strong>[]</strong>(key, create = false)
489
+
490
+
491
+
492
+
493
+
494
+ </h3><div class="docstring">
495
+ <div class="discussion">
496
+
497
+ <p>Gets a subtree by the label of the edge leading to it.</p>
498
+
499
+
500
+ </div>
501
+ </div>
502
+ <div class="tags">
503
+ <p class="tag_title">Parameters:</p>
504
+ <ul class="param">
505
+
506
+ <li>
507
+
508
+ <span class='name'>key</span>
509
+
510
+
511
+ <span class='type'>(<tt>String</tt>)</span>
512
+
513
+
514
+
515
+ &mdash;
516
+ <div class='inline'>
517
+ <p>The edge label.</p>
518
+ </div>
519
+
520
+ </li>
521
+
522
+ <li>
523
+
524
+ <span class='name'>create</span>
525
+
526
+
527
+ <span class='type'>(<tt>Boolean</tt>)</span>
528
+
529
+
530
+ <em class="default">(defaults to: <tt>false</tt>)</em>
531
+
532
+
533
+ &mdash;
534
+ <div class='inline'>
535
+ <p>Whether or not the create a new Node if there is no edge with the label
536
+ given.</p>
537
+ </div>
538
+
539
+ </li>
540
+
541
+ </ul>
542
+
543
+ <p class="tag_title">Returns:</p>
544
+ <ul class="return">
545
+
546
+ <li>
547
+
548
+
549
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Imp::Tree (class)">Tree</a></span></tt>, <tt>nil</tt>)</span>
550
+
551
+
552
+
553
+ &mdash;
554
+ <div class='inline'>
555
+ <p>The tree at the edge, or nil if it didn&#39;t exist annd create was false.</p>
556
+ </div>
557
+
558
+ </li>
559
+
560
+ </ul>
561
+
562
+ </div><table class="source_code">
563
+ <tr>
564
+ <td>
565
+ <pre class="lines">
566
+
567
+
568
+ 28
569
+ 29
570
+ 30
571
+ 31
572
+ 32
573
+ 33
574
+ 34</pre>
575
+ </td>
576
+ <td>
577
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 28</span>
578
+
579
+ <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
580
+ <span class='kw'>if</span> <span class='id identifier rubyid_create'>create</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_key'>key</span>
581
+ <span class='ivar'>@succ</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Tree</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
582
+ <span class='kw'>else</span>
583
+ <span class='ivar'>@succ</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
584
+ <span class='kw'>end</span>
585
+ <span class='kw'>end</span></pre>
586
+ </td>
587
+ </tr>
588
+ </table>
589
+ </div>
590
+
591
+ <div class="method_details ">
592
+ <h3 class="signature " id="delete-instance_method">
593
+
594
+ - (<tt>Object</tt>) <strong>delete</strong>(key)
595
+
596
+
597
+
598
+
599
+
600
+ </h3><div class="docstring">
601
+ <div class="discussion">
602
+
603
+ <p>Removes a subtree by the label of the edge leading to it.</p>
604
+
605
+
606
+ </div>
607
+ </div>
608
+ <div class="tags">
609
+ <p class="tag_title">Parameters:</p>
610
+ <ul class="param">
611
+
612
+ <li>
613
+
614
+ <span class='name'>key</span>
615
+
616
+
617
+ <span class='type'>(<tt>String</tt>)</span>
618
+
619
+
620
+
621
+ &mdash;
622
+ <div class='inline'>
623
+ <p>The edge label.s</p>
624
+ </div>
625
+
626
+ </li>
627
+
628
+ </ul>
629
+
630
+
631
+ </div><table class="source_code">
632
+ <tr>
633
+ <td>
634
+ <pre class="lines">
635
+
636
+
637
+ 39
638
+ 40
639
+ 41</pre>
640
+ </td>
641
+ <td>
642
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 39</span>
643
+
644
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
645
+ <span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_key'>key</span>
646
+ <span class='kw'>end</span></pre>
647
+ </td>
648
+ </tr>
649
+ </table>
650
+ </div>
651
+
652
+ <div class="method_details ">
653
+ <h3 class="signature " id="descendant-instance_method">
654
+
655
+ - (<tt><span class='object_link'><a href="" title="Imp::Tree (class)">Tree</a></span></tt><sup>?</sup>) <strong>descendant</strong>(key, create = false)
656
+
657
+
658
+
659
+
660
+
661
+ </h3><div class="docstring">
662
+ <div class="discussion">
663
+
664
+ <p>Gets a (more distant descendant of the current node.</p>
665
+
666
+
667
+ </div>
668
+ </div>
669
+ <div class="tags">
670
+ <p class="tag_title">Parameters:</p>
671
+ <ul class="param">
672
+
673
+ <li>
674
+
675
+ <span class='name'>key</span>
676
+
677
+
678
+ <span class='type'>(<tt>String</tt>)</span>
679
+
680
+
681
+
682
+ &mdash;
683
+ <div class='inline'>
684
+ <p>A forward-slash seperated list of the edge labels to follow.</p>
685
+ </div>
686
+
687
+ </li>
688
+
689
+ <li>
690
+
691
+ <span class='name'>create</span>
692
+
693
+
694
+ <span class='type'>(<tt>Boolean</tt>)</span>
695
+
696
+
697
+ <em class="default">(defaults to: <tt>false</tt>)</em>
698
+
699
+
700
+ &mdash;
701
+ <div class='inline'>
702
+ <p>Whether or not to create nodes if the edge labels aren&#39;t used yet.</p>
703
+ </div>
704
+
705
+ </li>
706
+
707
+ </ul>
708
+
709
+ <p class="tag_title">Returns:</p>
710
+ <ul class="return">
711
+
712
+ <li>
713
+
714
+
715
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Imp::Tree (class)">Tree</a></span></tt>, <tt>nil</tt>)</span>
716
+
717
+
718
+
719
+ &mdash;
720
+ <div class='inline'>
721
+ <p>The node connected through the edge labels, or nil if there is no such node
722
+ and create was false.</p>
723
+ </div>
724
+
725
+ </li>
726
+
727
+ </ul>
728
+
729
+ </div><table class="source_code">
730
+ <tr>
731
+ <td>
732
+ <pre class="lines">
733
+
734
+
735
+ 74
736
+ 75
737
+ 76
738
+ 77
739
+ 78
740
+ 79
741
+ 80
742
+ 81
743
+ 82
744
+ 83
745
+ 84</pre>
746
+ </td>
747
+ <td>
748
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 74</span>
749
+
750
+ <span class='kw'>def</span> <span class='id identifier rubyid_descendant'>descendant</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
751
+ <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span>
752
+ <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span>
753
+ <span class='id identifier rubyid_child'>child</span> <span class='op'>=</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span><span class='rbracket'>]</span>
754
+ <span class='kw'>if</span> <span class='id identifier rubyid_child'>child</span>
755
+ <span class='id identifier rubyid_child'>child</span><span class='period'>.</span><span class='id identifier rubyid_descendant'>descendant</span><span class='lparen'>(</span><span class='id identifier rubyid_keys'>keys</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span><span class='rparen'>)</span>
756
+ <span class='kw'>end</span>
757
+ <span class='kw'>else</span>
758
+ <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span><span class='rbracket'>]</span>
759
+ <span class='kw'>end</span>
760
+ <span class='kw'>end</span></pre>
761
+ </td>
762
+ </tr>
763
+ </table>
764
+ </div>
765
+
766
+ <div class="method_details ">
767
+ <h3 class="signature " id="each-instance_method">
768
+
769
+ - (<tt>Object</tt>) <strong>each</strong> {|String, Tree| ... }
770
+
771
+
772
+
773
+
774
+
775
+ </h3><div class="docstring">
776
+ <div class="discussion">
777
+
778
+ <p>Iterates over (edge, node) pairs.</p>
779
+
780
+
781
+ </div>
782
+ </div>
783
+ <div class="tags">
784
+
785
+ <p class="tag_title">Yields:</p>
786
+ <ul class="yield">
787
+
788
+ <li>
789
+
790
+
791
+ <span class='type'>(<tt>String</tt>, <tt><span class='object_link'><a href="" title="Imp::Tree (class)">Tree</a></span></tt>)</span>
792
+
793
+
794
+
795
+ &mdash;
796
+ <div class='inline'>
797
+ <p>Edge, node pairs of connected nodes.</p>
798
+ </div>
799
+
800
+ </li>
801
+
802
+ </ul>
803
+
804
+ </div><table class="source_code">
805
+ <tr>
806
+ <td>
807
+ <pre class="lines">
808
+
809
+
810
+ 53
811
+ 54
812
+ 55</pre>
813
+ </td>
814
+ <td>
815
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 53</span>
816
+
817
+ <span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
818
+ <span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
819
+ <span class='kw'>end</span></pre>
820
+ </td>
821
+ </tr>
822
+ </table>
823
+ </div>
824
+
825
+ <div class="method_details ">
826
+ <h3 class="signature " id="include?-instance_method">
827
+
828
+ - (<tt>Boolean</tt>) <strong>include?</strong>(item)
829
+
830
+
831
+
832
+
833
+
834
+ </h3><div class="docstring">
835
+ <div class="discussion">
836
+
837
+ <p>Checks if an edge is included.</p>
838
+
839
+
840
+ </div>
841
+ </div>
842
+ <div class="tags">
843
+ <p class="tag_title">Parameters:</p>
844
+ <ul class="param">
845
+
846
+ <li>
847
+
848
+ <span class='name'>item</span>
849
+
850
+
851
+ <span class='type'>(<tt>String</tt>)</span>
852
+
853
+
854
+
855
+ &mdash;
856
+ <div class='inline'>
857
+ <p>The string to check.</p>
858
+ </div>
859
+
860
+ </li>
861
+
862
+ </ul>
863
+
864
+ <p class="tag_title">Returns:</p>
865
+ <ul class="return">
866
+
867
+ <li>
868
+
869
+
870
+ <span class='type'>(<tt>Boolean</tt>)</span>
871
+
872
+
873
+
874
+ &mdash;
875
+ <div class='inline'>
876
+ <p>Whether or not the string is an edge label going out from this node.</p>
877
+ </div>
878
+
879
+ </li>
880
+
881
+ </ul>
882
+
883
+ </div><table class="source_code">
884
+ <tr>
885
+ <td>
886
+ <pre class="lines">
887
+
888
+
889
+ 62
890
+ 63
891
+ 64</pre>
892
+ </td>
893
+ <td>
894
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 62</span>
895
+
896
+ <span class='kw'>def</span> <span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_item'>item</span>
897
+ <span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_item'>item</span>
898
+ <span class='kw'>end</span></pre>
899
+ </td>
900
+ </tr>
901
+ </table>
902
+ </div>
903
+
904
+ <div class="method_details ">
905
+ <h3 class="signature " id="leaf?-instance_method">
906
+
907
+ - (<tt>Boolean</tt>) <strong>leaf?</strong>
908
+
909
+
910
+
911
+
912
+
913
+ </h3><div class="docstring">
914
+ <div class="discussion">
915
+
916
+ <p>Checks if this is a leaf node.</p>
917
+
918
+
919
+ </div>
920
+ </div>
921
+ <div class="tags">
922
+
923
+ <p class="tag_title">Returns:</p>
924
+ <ul class="return">
925
+
926
+ <li>
927
+
928
+
929
+ <span class='type'>(<tt>Boolean</tt>)</span>
930
+
931
+
932
+
933
+ &mdash;
934
+ <div class='inline'>
935
+ <p>Wheter or not the node is a leaf.</p>
936
+ </div>
937
+
938
+ </li>
939
+
940
+ </ul>
941
+
942
+ </div><table class="source_code">
943
+ <tr>
944
+ <td>
945
+ <pre class="lines">
946
+
947
+
948
+ 46
949
+ 47
950
+ 48</pre>
951
+ </td>
952
+ <td>
953
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 46</span>
954
+
955
+ <span class='kw'>def</span> <span class='id identifier rubyid_leaf?'>leaf?</span>
956
+ <span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
957
+ <span class='kw'>end</span></pre>
958
+ </td>
959
+ </tr>
960
+ </table>
961
+ </div>
962
+
963
+ <div class="method_details ">
964
+ <h3 class="signature " id="to_s-instance_method">
965
+
966
+ - (<tt>String</tt>) <strong>to_s</strong>(indent = 0)
967
+
968
+
969
+
970
+
971
+
972
+ </h3><div class="docstring">
973
+ <div class="discussion">
974
+
975
+ <p>Prints the skeleton of the tree. Node labels are NOT printed.</p>
976
+
977
+
978
+ </div>
979
+ </div>
980
+ <div class="tags">
981
+ <p class="tag_title">Parameters:</p>
982
+ <ul class="param">
983
+
984
+ <li>
985
+
986
+ <span class='name'>indent</span>
987
+
988
+
989
+ <span class='type'>(<tt>Int</tt>)</span>
990
+
991
+
992
+ <em class="default">(defaults to: <tt>0</tt>)</em>
993
+
994
+
995
+ &mdash;
996
+ <div class='inline'>
997
+ <p>By how many stages to indent the tree.</p>
998
+ </div>
999
+
1000
+ </li>
1001
+
1002
+ </ul>
1003
+
1004
+ <p class="tag_title">Returns:</p>
1005
+ <ul class="return">
1006
+
1007
+ <li>
1008
+
1009
+
1010
+ <span class='type'>(<tt>String</tt>)</span>
1011
+
1012
+
1013
+
1014
+ &mdash;
1015
+ <div class='inline'>
1016
+ <p>The skeleton of the tree.</p>
1017
+ </div>
1018
+
1019
+ </li>
1020
+
1021
+ </ul>
1022
+
1023
+ </div><table class="source_code">
1024
+ <tr>
1025
+ <td>
1026
+ <pre class="lines">
1027
+
1028
+
1029
+ 90
1030
+ 91
1031
+ 92
1032
+ 93
1033
+ 94
1034
+ 95
1035
+ 96
1036
+ 97
1037
+ 98
1038
+ 99
1039
+ 100
1040
+ 101</pre>
1041
+ </td>
1042
+ <td>
1043
+ <pre class="code"><span class="info file"># File 'lib/imp/tree.rb', line 90</span>
1044
+
1045
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_indent'>indent</span> <span class='op'>=</span> <span class='int'>0</span><span class='rparen'>)</span>
1046
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1047
+ <span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
1048
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> </span><span class='tstring_end'>&#39;</span></span> <span class='op'>*</span> <span class='id identifier rubyid_indent'>indent</span>
1049
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>+=</span> <span class='id identifier rubyid_k'>k</span>
1050
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_leaf?'>leaf?</span>
1051
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_val'>val</span>
1052
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
1053
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>+=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_indent'>indent</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span>
1054
+ <span class='kw'>end</span>
1055
+ <span class='kw'>return</span> <span class='id identifier rubyid_s'>s</span>
1056
+ <span class='kw'>end</span></pre>
1057
+ </td>
1058
+ </tr>
1059
+ </table>
1060
+ </div>
1061
+
1062
+ </div>
1063
+
1064
+ </div>
1065
+
1066
+ <div id="footer">
1067
+ Generated on Sun Nov 10 00:39:21 2013 by
1068
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1069
+ 0.8.7.3 (ruby-2.0.0).
1070
+ </div>
1071
+
1072
+ </body>
1073
+ </html>