chess_openings 0.0.3 → 1.0.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.
@@ -0,0 +1,1081 @@
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: SearchTree
8
+
9
+ &mdash; Documentation by YARD 0.9.7
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
+ pathId = "SearchTree";
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> &raquo;
40
+
41
+
42
+ <span class="title">SearchTree</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: SearchTree
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">SearchTree</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/chess_openings/search_tree.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Class that is a Tree-like data structure to hold all Openings</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div><h2>Defined Under Namespace</h2>
114
+ <p class="children">
115
+
116
+
117
+
118
+
119
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="SearchTree/Node.html" title="SearchTree::Node (class)">Node</a></span>
120
+
121
+
122
+ </p>
123
+
124
+
125
+
126
+
127
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
128
+ <ul class="summary">
129
+
130
+ <li class="public ">
131
+ <span class="summary_signature">
132
+
133
+ <a href="#root-instance_method" title="#root (instance method)">#<strong>root</strong> &#x21d2; Object </a>
134
+
135
+
136
+
137
+ </span>
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="summary_desc"><div class='inline'>
151
+ <p>Returns the value of attribute root.</p>
152
+ </div></span>
153
+
154
+ </li>
155
+
156
+
157
+ </ul>
158
+
159
+
160
+
161
+
162
+
163
+ <h2>
164
+ Instance Method Summary
165
+ <small><a href="#" class="summary_toggle">collapse</a></small>
166
+ </h2>
167
+
168
+ <ul class="summary">
169
+
170
+ <li class="public ">
171
+ <span class="summary_signature">
172
+
173
+ <a href="#==-instance_method" title="#== (instance method)">#<strong>==</strong>(other) &#x21d2; Boolean </a>
174
+
175
+
176
+
177
+ </span>
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <span class="summary_desc"><div class='inline'>
188
+ <p>Compares two trees.</p>
189
+ </div></span>
190
+
191
+ </li>
192
+
193
+
194
+ <li class="public ">
195
+ <span class="summary_signature">
196
+
197
+ <a href="#empty%3F-instance_method" title="#empty? (instance method)">#<strong>empty?</strong> &#x21d2; Boolean </a>
198
+
199
+
200
+
201
+ </span>
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+ <span class="summary_desc"><div class='inline'>
212
+ <p>Check if tree doesnt have child Nodes and root is empty.</p>
213
+ </div></span>
214
+
215
+ </li>
216
+
217
+
218
+ <li class="public ">
219
+ <span class="summary_signature">
220
+
221
+ <a href="#get_moves_in_depth-instance_method" title="#get_moves_in_depth (instance method)">#<strong>get_moves_in_depth</strong>(num) &#x21d2; Array </a>
222
+
223
+
224
+
225
+ </span>
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+ <span class="summary_desc"><div class='inline'>
236
+ <p>Get all values at a certain depth.</p>
237
+ </div></span>
238
+
239
+ </li>
240
+
241
+
242
+ <li class="public ">
243
+ <span class="summary_signature">
244
+
245
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; SearchTree </a>
246
+
247
+
248
+
249
+ </span>
250
+
251
+
252
+ <span class="note title constructor">constructor</span>
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+ <span class="summary_desc"><div class='inline'>
262
+ <p>A new instance of SearchTree.</p>
263
+ </div></span>
264
+
265
+ </li>
266
+
267
+
268
+ <li class="public ">
269
+ <span class="summary_signature">
270
+
271
+ <a href="#insert-instance_method" title="#insert (instance method)">#<strong>insert</strong>(moves, value) &#x21d2; Object </a>
272
+
273
+
274
+
275
+ </span>
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+ <span class="summary_desc"><div class='inline'>
286
+ <p>Insert new value in SearchTree at the depth of the moves.</p>
287
+ </div></span>
288
+
289
+ </li>
290
+
291
+
292
+ <li class="public ">
293
+ <span class="summary_signature">
294
+
295
+ <a href="#search-instance_method" title="#search (instance method)">#<strong>search</strong>(moves) &#x21d2; Opening </a>
296
+
297
+
298
+
299
+ </span>
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+ <span class="summary_desc"><div class='inline'>
310
+ <p>Search in the tree with the path moves.</p>
311
+ </div></span>
312
+
313
+ </li>
314
+
315
+
316
+ <li class="public ">
317
+ <span class="summary_signature">
318
+
319
+ <a href="#search_all_with_moves-instance_method" title="#search_all_with_moves (instance method)">#<strong>search_all_with_moves</strong>(moves) &#x21d2; Array </a>
320
+
321
+
322
+
323
+ </span>
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+ <span class="summary_desc"><div class='inline'>
334
+ <p>Search the tree for all the values from the path and values of its
335
+ children.</p>
336
+ </div></span>
337
+
338
+ </li>
339
+
340
+
341
+ <li class="public ">
342
+ <span class="summary_signature">
343
+
344
+ <a href="#size-instance_method" title="#size (instance method)">#<strong>size</strong> &#x21d2; int </a>
345
+
346
+
347
+
348
+ </span>
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+ <span class="summary_desc"><div class='inline'>
359
+ <p>Number of not empty Nodes.</p>
360
+ </div></span>
361
+
362
+ </li>
363
+
364
+
365
+ <li class="public ">
366
+ <span class="summary_signature">
367
+
368
+ <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; String </a>
369
+
370
+
371
+
372
+ </span>
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+ <span class="summary_desc"><div class='inline'>
383
+ <p>String representation of the tree.</p>
384
+ </div></span>
385
+
386
+ </li>
387
+
388
+
389
+ </ul>
390
+
391
+
392
+ <div id="constructor_details" class="method_details_list">
393
+ <h2>Constructor Details</h2>
394
+
395
+ <div class="method_details first">
396
+ <h3 class="signature first" id="initialize-instance_method">
397
+
398
+ #<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="SearchTree (class)">SearchTree</a></span></tt>
399
+
400
+
401
+
402
+
403
+
404
+ </h3><div class="docstring">
405
+ <div class="discussion">
406
+
407
+ <p>Returns a new instance of SearchTree</p>
408
+
409
+
410
+ </div>
411
+ </div>
412
+ <div class="tags">
413
+
414
+
415
+ </div><table class="source_code">
416
+ <tr>
417
+ <td>
418
+ <pre class="lines">
419
+
420
+
421
+ 8
422
+ 9
423
+ 10</pre>
424
+ </td>
425
+ <td>
426
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 8</span>
427
+
428
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
429
+ <span class='ivar'>@root</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="SearchTree/Node.html" title="SearchTree::Node (class)">Node</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="SearchTree/Node.html#initialize-instance_method" title="SearchTree::Node#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>nil</span><span class='rparen'>)</span>
430
+ <span class='kw'>end</span></pre>
431
+ </td>
432
+ </tr>
433
+ </table>
434
+ </div>
435
+
436
+ </div>
437
+
438
+ <div id="instance_attr_details" class="attr_details">
439
+ <h2>Instance Attribute Details</h2>
440
+
441
+
442
+ <span id="root=-instance_method"></span>
443
+ <div class="method_details first">
444
+ <h3 class="signature first" id="root-instance_method">
445
+
446
+ #<strong>root</strong> &#x21d2; <tt>Object</tt>
447
+
448
+
449
+
450
+
451
+
452
+ </h3><div class="docstring">
453
+ <div class="discussion">
454
+
455
+ <p>Returns the value of attribute root</p>
456
+
457
+
458
+ </div>
459
+ </div>
460
+ <div class="tags">
461
+
462
+
463
+ </div><table class="source_code">
464
+ <tr>
465
+ <td>
466
+ <pre class="lines">
467
+
468
+
469
+ 6
470
+ 7
471
+ 8</pre>
472
+ </td>
473
+ <td>
474
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 6</span>
475
+
476
+ <span class='kw'>def</span> <span class='id identifier rubyid_root'><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span>
477
+ <span class='ivar'>@root</span>
478
+ <span class='kw'>end</span></pre>
479
+ </td>
480
+ </tr>
481
+ </table>
482
+ </div>
483
+
484
+ </div>
485
+
486
+
487
+ <div id="instance_method_details" class="method_details_list">
488
+ <h2>Instance Method Details</h2>
489
+
490
+
491
+ <div class="method_details first">
492
+ <h3 class="signature first" id="==-instance_method">
493
+
494
+ #<strong>==</strong>(other) &#x21d2; <tt>Boolean</tt>
495
+
496
+
497
+
498
+
499
+
500
+ </h3><div class="docstring">
501
+ <div class="discussion">
502
+
503
+ <p>Compares two trees</p>
504
+
505
+
506
+ </div>
507
+ </div>
508
+ <div class="tags">
509
+ <p class="tag_title">Parameters:</p>
510
+ <ul class="param">
511
+
512
+ <li>
513
+
514
+ <span class='name'>other</span>
515
+
516
+
517
+ <span class='type'>(<tt><span class='object_link'><a href="" title="SearchTree (class)">SearchTree</a></span></tt>)</span>
518
+
519
+
520
+
521
+ &mdash;
522
+ <div class='inline'>
523
+ <p>SearchTree to be compared with</p>
524
+ </div>
525
+
526
+ </li>
527
+
528
+ </ul>
529
+
530
+ <p class="tag_title">Returns:</p>
531
+ <ul class="return">
532
+
533
+ <li>
534
+
535
+
536
+ <span class='type'>(<tt>Boolean</tt>)</span>
537
+
538
+
539
+
540
+ &mdash;
541
+ <div class='inline'>
542
+ <p>True if both trees have the same children with the same values</p>
543
+ </div>
544
+
545
+ </li>
546
+
547
+ </ul>
548
+
549
+ </div><table class="source_code">
550
+ <tr>
551
+ <td>
552
+ <pre class="lines">
553
+
554
+
555
+ 37
556
+ 38
557
+ 39</pre>
558
+ </td>
559
+ <td>
560
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 37</span>
561
+
562
+ <span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
563
+ <span class='ivar'>@root</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span>
564
+ <span class='kw'>end</span></pre>
565
+ </td>
566
+ </tr>
567
+ </table>
568
+ </div>
569
+
570
+ <div class="method_details ">
571
+ <h3 class="signature " id="empty?-instance_method">
572
+
573
+ #<strong>empty?</strong> &#x21d2; <tt>Boolean</tt>
574
+
575
+
576
+
577
+
578
+
579
+ </h3><div class="docstring">
580
+ <div class="discussion">
581
+
582
+ <p>Check if tree doesnt have child Nodes and root is empty</p>
583
+
584
+
585
+ </div>
586
+ </div>
587
+ <div class="tags">
588
+
589
+ <p class="tag_title">Returns:</p>
590
+ <ul class="return">
591
+
592
+ <li>
593
+
594
+
595
+ <span class='type'>(<tt>Boolean</tt>)</span>
596
+
597
+
598
+
599
+ &mdash;
600
+ <div class='inline'>
601
+ <p>True if the tree doesnt have childs and root value is nil, false otherwise</p>
602
+ </div>
603
+
604
+ </li>
605
+
606
+ </ul>
607
+
608
+ </div><table class="source_code">
609
+ <tr>
610
+ <td>
611
+ <pre class="lines">
612
+
613
+
614
+ 15
615
+ 16
616
+ 17</pre>
617
+ </td>
618
+ <td>
619
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 15</span>
620
+
621
+ <span class='kw'>def</span> <span class='id identifier rubyid_empty?'>empty?</span>
622
+ <span class='ivar'>@root</span><span class='period'>.</span><span class='id identifier rubyid_is_empty?'>is_empty?</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@root</span><span class='period'>.</span><span class='id identifier rubyid_is_leaf?'>is_leaf?</span>
623
+ <span class='kw'>end</span></pre>
624
+ </td>
625
+ </tr>
626
+ </table>
627
+ </div>
628
+
629
+ <div class="method_details ">
630
+ <h3 class="signature " id="get_moves_in_depth-instance_method">
631
+
632
+ #<strong>get_moves_in_depth</strong>(num) &#x21d2; <tt>Array</tt>
633
+
634
+
635
+
636
+
637
+
638
+ </h3><div class="docstring">
639
+ <div class="discussion">
640
+
641
+ <p>Get all values at a certain depth</p>
642
+
643
+
644
+ </div>
645
+ </div>
646
+ <div class="tags">
647
+ <p class="tag_title">Parameters:</p>
648
+ <ul class="param">
649
+
650
+ <li>
651
+
652
+ <span class='name'>num</span>
653
+
654
+
655
+ <span class='type'>(<tt>int</tt>)</span>
656
+
657
+
658
+
659
+ &mdash;
660
+ <div class='inline'>
661
+ <p>Depth to be used to find values</p>
662
+ </div>
663
+
664
+ </li>
665
+
666
+ </ul>
667
+
668
+ <p class="tag_title">Returns:</p>
669
+ <ul class="return">
670
+
671
+ <li>
672
+
673
+
674
+ <span class='type'>(<tt>Array</tt>)</span>
675
+
676
+
677
+
678
+ &mdash;
679
+ <div class='inline'>
680
+ <p>Array with all the values found at depth num</p>
681
+ </div>
682
+
683
+ </li>
684
+
685
+ </ul>
686
+
687
+ </div><table class="source_code">
688
+ <tr>
689
+ <td>
690
+ <pre class="lines">
691
+
692
+
693
+ 73
694
+ 74
695
+ 75</pre>
696
+ </td>
697
+ <td>
698
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 73</span>
699
+
700
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_moves_in_depth'>get_moves_in_depth</span><span class='lparen'>(</span><span class='id identifier rubyid_num'>num</span><span class='rparen'>)</span>
701
+ <span class='id identifier rubyid_get_moves_in_depth_helper'>get_moves_in_depth_helper</span><span class='lparen'>(</span><span class='id identifier rubyid_num'>num</span><span class='comma'>,</span> <span class='ivar'>@root</span><span class='comma'>,</span> <span class='int'>0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
702
+ <span class='kw'>end</span></pre>
703
+ </td>
704
+ </tr>
705
+ </table>
706
+ </div>
707
+
708
+ <div class="method_details ">
709
+ <h3 class="signature " id="insert-instance_method">
710
+
711
+ #<strong>insert</strong>(moves, value) &#x21d2; <tt>Object</tt>
712
+
713
+
714
+
715
+
716
+
717
+ </h3><div class="docstring">
718
+ <div class="discussion">
719
+
720
+ <p>Insert new value in SearchTree at the depth of the moves</p>
721
+
722
+
723
+ </div>
724
+ </div>
725
+ <div class="tags">
726
+ <p class="tag_title">Parameters:</p>
727
+ <ul class="param">
728
+
729
+ <li>
730
+
731
+ <span class='name'>moves</span>
732
+
733
+
734
+ <span class='type'>(<tt>Array</tt>)</span>
735
+
736
+
737
+
738
+ &mdash;
739
+ <div class='inline'>
740
+ <p>Path to the place to insert the value</p>
741
+ </div>
742
+
743
+ </li>
744
+
745
+ <li>
746
+
747
+ <span class='name'>value</span>
748
+
749
+
750
+ <span class='type'>(<tt><span class='object_link'><a href="Opening.html" title="Opening (class)">Opening</a></span></tt>)</span>
751
+
752
+
753
+
754
+ &mdash;
755
+ <div class='inline'>
756
+ <p>Value to be inserted in the tree</p>
757
+ </div>
758
+
759
+ </li>
760
+
761
+ </ul>
762
+
763
+
764
+ </div><table class="source_code">
765
+ <tr>
766
+ <td>
767
+ <pre class="lines">
768
+
769
+
770
+ 45
771
+ 46
772
+ 47
773
+ 48</pre>
774
+ </td>
775
+ <td>
776
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 45</span>
777
+
778
+ <span class='kw'>def</span> <span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
779
+ <span class='id identifier rubyid_moves'>moves</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ChessOpeningsHelper.html" title="ChessOpeningsHelper (class)">ChessOpeningsHelper</a></span></span><span class='period'>.</span><span class='id identifier rubyid_moves_as_symbols'><span class='object_link'><a href="ChessOpeningsHelper.html#moves_as_symbols-class_method" title="ChessOpeningsHelper.moves_as_symbols (method)">moves_as_symbols</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='rparen'>)</span>
780
+ <span class='id identifier rubyid_insert_helper'>insert_helper</span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='ivar'>@root</span><span class='rparen'>)</span>
781
+ <span class='kw'>end</span></pre>
782
+ </td>
783
+ </tr>
784
+ </table>
785
+ </div>
786
+
787
+ <div class="method_details ">
788
+ <h3 class="signature " id="search-instance_method">
789
+
790
+ #<strong>search</strong>(moves) &#x21d2; <tt><span class='object_link'><a href="Opening.html" title="Opening (class)">Opening</a></span></tt>
791
+
792
+
793
+
794
+
795
+
796
+ </h3><div class="docstring">
797
+ <div class="discussion">
798
+
799
+ <p>Search in the tree with the path moves</p>
800
+
801
+
802
+ </div>
803
+ </div>
804
+ <div class="tags">
805
+ <p class="tag_title">Parameters:</p>
806
+ <ul class="param">
807
+
808
+ <li>
809
+
810
+ <span class='name'>moves</span>
811
+
812
+
813
+ <span class='type'>(<tt>Array</tt>)</span>
814
+
815
+
816
+
817
+ &mdash;
818
+ <div class='inline'>
819
+ <p>Array with Strings or symbols that represent the path</p>
820
+ </div>
821
+
822
+ </li>
823
+
824
+ </ul>
825
+
826
+ <p class="tag_title">Returns:</p>
827
+ <ul class="return">
828
+
829
+ <li>
830
+
831
+
832
+ <span class='type'>(<tt><span class='object_link'><a href="Opening.html" title="Opening (class)">Opening</a></span></tt>)</span>
833
+
834
+
835
+
836
+ &mdash;
837
+ <div class='inline'>
838
+ <p>Opening that was found in the tree, Nil otherwise</p>
839
+ </div>
840
+
841
+ </li>
842
+
843
+ </ul>
844
+
845
+ </div><table class="source_code">
846
+ <tr>
847
+ <td>
848
+ <pre class="lines">
849
+
850
+
851
+ 54
852
+ 55
853
+ 56
854
+ 57</pre>
855
+ </td>
856
+ <td>
857
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 54</span>
858
+
859
+ <span class='kw'>def</span> <span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='rparen'>)</span>
860
+ <span class='id identifier rubyid_moves'>moves</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ChessOpeningsHelper.html" title="ChessOpeningsHelper (class)">ChessOpeningsHelper</a></span></span><span class='period'>.</span><span class='id identifier rubyid_moves_as_symbols'><span class='object_link'><a href="ChessOpeningsHelper.html#moves_as_symbols-class_method" title="ChessOpeningsHelper.moves_as_symbols (method)">moves_as_symbols</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='rparen'>)</span>
861
+ <span class='id identifier rubyid_search_helper'>search_helper</span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='comma'>,</span> <span class='ivar'>@root</span><span class='rparen'>)</span>
862
+ <span class='kw'>end</span></pre>
863
+ </td>
864
+ </tr>
865
+ </table>
866
+ </div>
867
+
868
+ <div class="method_details ">
869
+ <h3 class="signature " id="search_all_with_moves-instance_method">
870
+
871
+ #<strong>search_all_with_moves</strong>(moves) &#x21d2; <tt>Array</tt>
872
+
873
+
874
+
875
+
876
+
877
+ </h3><div class="docstring">
878
+ <div class="discussion">
879
+
880
+ <p>Search the tree for all the values from the path and values of its children</p>
881
+
882
+
883
+ </div>
884
+ </div>
885
+ <div class="tags">
886
+ <p class="tag_title">Parameters:</p>
887
+ <ul class="param">
888
+
889
+ <li>
890
+
891
+ <span class='name'>moves</span>
892
+
893
+
894
+ <span class='type'>(<tt>Array</tt>)</span>
895
+
896
+
897
+
898
+ &mdash;
899
+ <div class='inline'>
900
+ <p>Array with Strings or symbols that represent the path</p>
901
+ </div>
902
+
903
+ </li>
904
+
905
+ </ul>
906
+
907
+ <p class="tag_title">Returns:</p>
908
+ <ul class="return">
909
+
910
+ <li>
911
+
912
+
913
+ <span class='type'>(<tt>Array</tt>)</span>
914
+
915
+
916
+
917
+ &mdash;
918
+ <div class='inline'>
919
+ <p>Array with values found</p>
920
+ </div>
921
+
922
+ </li>
923
+
924
+ </ul>
925
+
926
+ </div><table class="source_code">
927
+ <tr>
928
+ <td>
929
+ <pre class="lines">
930
+
931
+
932
+ 63
933
+ 64
934
+ 65
935
+ 66
936
+ 67</pre>
937
+ </td>
938
+ <td>
939
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 63</span>
940
+
941
+ <span class='kw'>def</span> <span class='id identifier rubyid_search_all_with_moves'>search_all_with_moves</span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='rparen'>)</span>
942
+ <span class='id identifier rubyid_moves'>moves</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ChessOpeningsHelper.html" title="ChessOpeningsHelper (class)">ChessOpeningsHelper</a></span></span><span class='period'>.</span><span class='id identifier rubyid_moves_as_symbols'><span class='object_link'><a href="ChessOpeningsHelper.html#moves_as_symbols-class_method" title="ChessOpeningsHelper.moves_as_symbols (method)">moves_as_symbols</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='rparen'>)</span>
943
+ <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='id identifier rubyid_find_node'>find_node</span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='comma'>,</span> <span class='ivar'>@root</span><span class='rparen'>)</span>
944
+ <span class='id identifier rubyid_get_all_from_node'>get_all_from_node</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
945
+ <span class='kw'>end</span></pre>
946
+ </td>
947
+ </tr>
948
+ </table>
949
+ </div>
950
+
951
+ <div class="method_details ">
952
+ <h3 class="signature " id="size-instance_method">
953
+
954
+ #<strong>size</strong> &#x21d2; <tt>int</tt>
955
+
956
+
957
+
958
+
959
+
960
+ </h3><div class="docstring">
961
+ <div class="discussion">
962
+
963
+ <p>Number of not empty Nodes</p>
964
+
965
+
966
+ </div>
967
+ </div>
968
+ <div class="tags">
969
+
970
+ <p class="tag_title">Returns:</p>
971
+ <ul class="return">
972
+
973
+ <li>
974
+
975
+
976
+ <span class='type'>(<tt>int</tt>)</span>
977
+
978
+
979
+
980
+ &mdash;
981
+ <div class='inline'>
982
+ <p>Total of not empty Nodes in the tree</p>
983
+ </div>
984
+
985
+ </li>
986
+
987
+ </ul>
988
+
989
+ </div><table class="source_code">
990
+ <tr>
991
+ <td>
992
+ <pre class="lines">
993
+
994
+
995
+ 22
996
+ 23
997
+ 24</pre>
998
+ </td>
999
+ <td>
1000
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 22</span>
1001
+
1002
+ <span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span>
1003
+ <span class='id identifier rubyid_size_helper'>size_helper</span><span class='lparen'>(</span><span class='ivar'>@root</span><span class='rparen'>)</span>
1004
+ <span class='kw'>end</span></pre>
1005
+ </td>
1006
+ </tr>
1007
+ </table>
1008
+ </div>
1009
+
1010
+ <div class="method_details ">
1011
+ <h3 class="signature " id="to_s-instance_method">
1012
+
1013
+ #<strong>to_s</strong> &#x21d2; <tt>String</tt>
1014
+
1015
+
1016
+
1017
+
1018
+
1019
+ </h3><div class="docstring">
1020
+ <div class="discussion">
1021
+
1022
+ <p>String representation of the tree</p>
1023
+
1024
+
1025
+ </div>
1026
+ </div>
1027
+ <div class="tags">
1028
+
1029
+ <p class="tag_title">Returns:</p>
1030
+ <ul class="return">
1031
+
1032
+ <li>
1033
+
1034
+
1035
+ <span class='type'>(<tt>String</tt>)</span>
1036
+
1037
+
1038
+
1039
+ &mdash;
1040
+ <div class='inline'>
1041
+ <p>Representation of the Nodes in the tree</p>
1042
+ </div>
1043
+
1044
+ </li>
1045
+
1046
+ </ul>
1047
+
1048
+ </div><table class="source_code">
1049
+ <tr>
1050
+ <td>
1051
+ <pre class="lines">
1052
+
1053
+
1054
+ 29
1055
+ 30
1056
+ 31</pre>
1057
+ </td>
1058
+ <td>
1059
+ <pre class="code"><span class="info file"># File 'lib/chess_openings/search_tree.rb', line 29</span>
1060
+
1061
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
1062
+ <span class='ivar'>@root</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
1063
+ <span class='kw'>end</span></pre>
1064
+ </td>
1065
+ </tr>
1066
+ </table>
1067
+ </div>
1068
+
1069
+ </div>
1070
+
1071
+ </div>
1072
+
1073
+ <div id="footer">
1074
+ Generated on Thu Jan 12 10:12:17 2017 by
1075
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1076
+ 0.9.7 (ruby-2.2.0).
1077
+ </div>
1078
+
1079
+ </div>
1080
+ </body>
1081
+ </html>