nutrientes12345 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +9 -0
- data/Guardfile +10 -0
- data/README.md +37 -0
- data/Rakefile +8 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Alimento.html +743 -0
- data/docs/AlimentosCarbohidratos.html +157 -0
- data/docs/AlimentosGrasos.html +157 -0
- data/docs/CarnesDerivados.html +157 -0
- data/docs/Frutas.html +157 -0
- data/docs/HuevosLacteosHelados.html +157 -0
- data/docs/List.html +903 -0
- data/docs/List/Node.html +410 -0
- data/docs/Nutrientes.html +144 -0
- data/docs/PescadosMariscos.html +157 -0
- data/docs/VerdurasHortalizas.html +157 -0
- data/docs/_index.html +218 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +492 -0
- data/docs/file.README.html +125 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +125 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +219 -0
- data/docs/top-level-namespace.html +112 -0
- data/lib/jerarquia.rb +37 -0
- data/lib/list.rb +99 -0
- data/lib/nutrientes.rb +59 -0
- data/lib/nutrientes/version.rb +13 -0
- data/lib/plato.rb +141 -0
- data/nutrientes.gemspec +29 -0
- metadata +169 -0
data/docs/Frutas.html
ADDED
@@ -0,0 +1,157 @@
|
|
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: Frutas
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
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 = "Frutas";
|
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 (F)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Frutas</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: Frutas
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Alimento.html" title="Alimento (class)">Alimento</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next"><span class='object_link'><a href="Alimento.html" title="Alimento (class)">Alimento</a></span></li>
|
78
|
+
|
79
|
+
<li class="next">Frutas</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/jerarquia.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>this is a subclass of the Alimento-class</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>Instance Attribute Summary</h2>
|
122
|
+
|
123
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Alimento.html" title="Alimento (class)">Alimento</a></span></h3>
|
124
|
+
<p class="inherited"><span class='object_link'><a href="Alimento.html#glucidos-instance_method" title="Alimento#glucidos (method)">#glucidos</a></span>, <span class='object_link'><a href="Alimento.html#grasas-instance_method" title="Alimento#grasas (method)">#grasas</a></span>, <span class='object_link'><a href="Alimento.html#nombre-instance_method" title="Alimento#nombre (method)">#nombre</a></span>, <span class='object_link'><a href="Alimento.html#proteinas-instance_method" title="Alimento#proteinas (method)">#proteinas</a></span></p>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<h2>Method Summary</h2>
|
135
|
+
|
136
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Alimento.html" title="Alimento (class)">Alimento</a></span></h3>
|
137
|
+
<p class="inherited"><span class='object_link'><a href="Alimento.html#<=>-instance_method" title="Alimento#<=> (method)">#<=></a></span>, <span class='object_link'><a href="Alimento.html#initialize-instance_method" title="Alimento#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Alimento.html#to_s-instance_method" title="Alimento#to_s (method)">#to_s</a></span>, <span class='object_link'><a href="Alimento.html#valorEnergetico-instance_method" title="Alimento#valorEnergetico (method)">#valorEnergetico</a></span></p>
|
138
|
+
|
139
|
+
<div id="constructor_details" class="method_details_list">
|
140
|
+
<h2>Constructor Details</h2>
|
141
|
+
|
142
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Alimento.html#initialize-instance_method" title="Alimento#initialize (method)">Alimento</a></span></p>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div id="footer">
|
150
|
+
Generated on Wed Nov 15 00:31:53 2017 by
|
151
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
152
|
+
0.9.9 (ruby-2.3.0).
|
153
|
+
</div>
|
154
|
+
|
155
|
+
</div>
|
156
|
+
</body>
|
157
|
+
</html>
|
@@ -0,0 +1,157 @@
|
|
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: HuevosLacteosHelados
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
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 = "HuevosLacteosHelados";
|
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 (H)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">HuevosLacteosHelados</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: HuevosLacteosHelados
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Alimento.html" title="Alimento (class)">Alimento</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next"><span class='object_link'><a href="Alimento.html" title="Alimento (class)">Alimento</a></span></li>
|
78
|
+
|
79
|
+
<li class="next">HuevosLacteosHelados</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/jerarquia.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>this is a subclass of the Alimento-class</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>Instance Attribute Summary</h2>
|
122
|
+
|
123
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Alimento.html" title="Alimento (class)">Alimento</a></span></h3>
|
124
|
+
<p class="inherited"><span class='object_link'><a href="Alimento.html#glucidos-instance_method" title="Alimento#glucidos (method)">#glucidos</a></span>, <span class='object_link'><a href="Alimento.html#grasas-instance_method" title="Alimento#grasas (method)">#grasas</a></span>, <span class='object_link'><a href="Alimento.html#nombre-instance_method" title="Alimento#nombre (method)">#nombre</a></span>, <span class='object_link'><a href="Alimento.html#proteinas-instance_method" title="Alimento#proteinas (method)">#proteinas</a></span></p>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<h2>Method Summary</h2>
|
135
|
+
|
136
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Alimento.html" title="Alimento (class)">Alimento</a></span></h3>
|
137
|
+
<p class="inherited"><span class='object_link'><a href="Alimento.html#<=>-instance_method" title="Alimento#<=> (method)">#<=></a></span>, <span class='object_link'><a href="Alimento.html#initialize-instance_method" title="Alimento#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Alimento.html#to_s-instance_method" title="Alimento#to_s (method)">#to_s</a></span>, <span class='object_link'><a href="Alimento.html#valorEnergetico-instance_method" title="Alimento#valorEnergetico (method)">#valorEnergetico</a></span></p>
|
138
|
+
|
139
|
+
<div id="constructor_details" class="method_details_list">
|
140
|
+
<h2>Constructor Details</h2>
|
141
|
+
|
142
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Alimento.html#initialize-instance_method" title="Alimento#initialize (method)">Alimento</a></span></p>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div id="footer">
|
150
|
+
Generated on Wed Nov 15 00:31:53 2017 by
|
151
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
152
|
+
0.9.9 (ruby-2.3.0).
|
153
|
+
</div>
|
154
|
+
|
155
|
+
</div>
|
156
|
+
</body>
|
157
|
+
</html>
|
data/docs/List.html
ADDED
@@ -0,0 +1,903 @@
|
|
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: List
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
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 = "List";
|
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 (L)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">List</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: List
|
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">List</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<dl>
|
91
|
+
<dt>Includes:</dt>
|
92
|
+
<dd>Enumerable</dd>
|
93
|
+
</dl>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dl>
|
101
|
+
<dt>Defined in:</dt>
|
102
|
+
<dd>lib/list.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
108
|
+
<div class="discussion">
|
109
|
+
|
110
|
+
<p>This class is used to represent double-linked lists It includes the mixin
|
111
|
+
Enumerable</p>
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="tags">
|
117
|
+
|
118
|
+
|
119
|
+
</div><h2>Defined Under Namespace</h2>
|
120
|
+
<p class="children">
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="List/Node.html" title="List::Node (class)">Node</a></span>
|
126
|
+
|
127
|
+
|
128
|
+
</p>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<h2>
|
138
|
+
Instance Method Summary
|
139
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
140
|
+
</h2>
|
141
|
+
|
142
|
+
<ul class="summary">
|
143
|
+
|
144
|
+
<li class="public ">
|
145
|
+
<span class="summary_signature">
|
146
|
+
|
147
|
+
<a href="#add-instance_method" title="#add (instance method)">#<strong>add</strong>(value) ⇒ Object </a>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
</span>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="summary_desc"><div class='inline'>
|
162
|
+
<p>adds a value to the end of the list, behind the former last element if
|
163
|
+
it's the first element, this becomes the new head and tail.</p>
|
164
|
+
</div></span>
|
165
|
+
|
166
|
+
</li>
|
167
|
+
|
168
|
+
|
169
|
+
<li class="public ">
|
170
|
+
<span class="summary_signature">
|
171
|
+
|
172
|
+
<a href="#addAll-instance_method" title="#addAll (instance method)">#<strong>addAll</strong>(array) ⇒ Object </a>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
</span>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<span class="summary_desc"><div class='inline'>
|
187
|
+
<p>adds all elements in the given Array to our list.</p>
|
188
|
+
</div></span>
|
189
|
+
|
190
|
+
</li>
|
191
|
+
|
192
|
+
|
193
|
+
<li class="public ">
|
194
|
+
<span class="summary_signature">
|
195
|
+
|
196
|
+
<a href="#each-instance_method" title="#each (instance method)">#<strong>each</strong> ⇒ Object </a>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="summary_desc"><div class='inline'>
|
211
|
+
<p>this method is included because we implement the method Enumerable.</p>
|
212
|
+
</div></span>
|
213
|
+
|
214
|
+
</li>
|
215
|
+
|
216
|
+
|
217
|
+
<li class="public ">
|
218
|
+
<span class="summary_signature">
|
219
|
+
|
220
|
+
<a href="#getNode-instance_method" title="#getNode (instance method)">#<strong>getNode</strong> ⇒ Object </a>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</span>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
<span class="summary_desc"><div class='inline'>
|
235
|
+
<p>returns the head-node.</p>
|
236
|
+
</div></span>
|
237
|
+
|
238
|
+
</li>
|
239
|
+
|
240
|
+
|
241
|
+
<li class="public ">
|
242
|
+
<span class="summary_signature">
|
243
|
+
|
244
|
+
<a href="#head-instance_method" title="#head (instance method)">#<strong>head</strong> ⇒ Object </a>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
</span>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
<span class="summary_desc"><div class='inline'>
|
259
|
+
<p>returns the value of the head.</p>
|
260
|
+
</div></span>
|
261
|
+
|
262
|
+
</li>
|
263
|
+
|
264
|
+
|
265
|
+
<li class="public ">
|
266
|
+
<span class="summary_signature">
|
267
|
+
|
268
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ List </a>
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
</span>
|
273
|
+
|
274
|
+
|
275
|
+
<span class="note title constructor">constructor</span>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
<span class="summary_desc"><div class='inline'>
|
285
|
+
<p>initializes the vales of the list's head and tail to nil.</p>
|
286
|
+
</div></span>
|
287
|
+
|
288
|
+
</li>
|
289
|
+
|
290
|
+
|
291
|
+
<li class="public ">
|
292
|
+
<span class="summary_signature">
|
293
|
+
|
294
|
+
<a href="#isEmpty%3F-instance_method" title="#isEmpty? (instance method)">#<strong>isEmpty?</strong> ⇒ Boolean </a>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
<span class="summary_desc"><div class='inline'>
|
309
|
+
<p>returns true if the list is empty and false else.</p>
|
310
|
+
</div></span>
|
311
|
+
|
312
|
+
</li>
|
313
|
+
|
314
|
+
|
315
|
+
<li class="public ">
|
316
|
+
<span class="summary_signature">
|
317
|
+
|
318
|
+
<a href="#tail-instance_method" title="#tail (instance method)">#<strong>tail</strong> ⇒ Object </a>
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
</span>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
<span class="summary_desc"><div class='inline'>
|
333
|
+
<p>returns the value of the tail.</p>
|
334
|
+
</div></span>
|
335
|
+
|
336
|
+
</li>
|
337
|
+
|
338
|
+
|
339
|
+
<li class="public ">
|
340
|
+
<span class="summary_signature">
|
341
|
+
|
342
|
+
<a href="#to_a-instance_method" title="#to_a (instance method)">#<strong>to_a</strong> ⇒ Object </a>
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
</span>
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
<span class="summary_desc"><div class='inline'>
|
357
|
+
<p>returns an array with all the values of this list.</p>
|
358
|
+
</div></span>
|
359
|
+
|
360
|
+
</li>
|
361
|
+
|
362
|
+
|
363
|
+
<li class="public ">
|
364
|
+
<span class="summary_signature">
|
365
|
+
|
366
|
+
<a href="#to_a_reverse-instance_method" title="#to_a_reverse (instance method)">#<strong>to_a_reverse</strong> ⇒ Object </a>
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
</span>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
<span class="summary_desc"><div class='inline'>
|
381
|
+
<p>returns an array with all the values of this list, but in a reverse order.</p>
|
382
|
+
</div></span>
|
383
|
+
|
384
|
+
</li>
|
385
|
+
|
386
|
+
|
387
|
+
</ul>
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
<div id="constructor_details" class="method_details_list">
|
392
|
+
<h2>Constructor Details</h2>
|
393
|
+
|
394
|
+
<div class="method_details first">
|
395
|
+
<h3 class="signature first" id="initialize-instance_method">
|
396
|
+
|
397
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="List (class)">List</a></span></tt>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
</h3><div class="docstring">
|
404
|
+
<div class="discussion">
|
405
|
+
|
406
|
+
<p>initializes the vales of the list's head and tail to nil</p>
|
407
|
+
|
408
|
+
|
409
|
+
</div>
|
410
|
+
</div>
|
411
|
+
<div class="tags">
|
412
|
+
|
413
|
+
|
414
|
+
</div><table class="source_code">
|
415
|
+
<tr>
|
416
|
+
<td>
|
417
|
+
<pre class="lines">
|
418
|
+
|
419
|
+
|
420
|
+
13
|
421
|
+
14
|
422
|
+
15
|
423
|
+
16
|
424
|
+
17
|
425
|
+
18</pre>
|
426
|
+
</td>
|
427
|
+
<td>
|
428
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 13</span>
|
429
|
+
|
430
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
431
|
+
|
432
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
433
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
434
|
+
|
435
|
+
<span class='kw'>end</span></pre>
|
436
|
+
</td>
|
437
|
+
</tr>
|
438
|
+
</table>
|
439
|
+
</div>
|
440
|
+
|
441
|
+
</div>
|
442
|
+
|
443
|
+
|
444
|
+
<div id="instance_method_details" class="method_details_list">
|
445
|
+
<h2>Instance Method Details</h2>
|
446
|
+
|
447
|
+
|
448
|
+
<div class="method_details first">
|
449
|
+
<h3 class="signature first" id="add-instance_method">
|
450
|
+
|
451
|
+
#<strong>add</strong>(value) ⇒ <tt>Object</tt>
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
</h3><div class="docstring">
|
458
|
+
<div class="discussion">
|
459
|
+
|
460
|
+
<p>adds a value to the end of the list, behind the former last element if
|
461
|
+
it's the first element, this becomes the new head and tail</p>
|
462
|
+
|
463
|
+
|
464
|
+
</div>
|
465
|
+
</div>
|
466
|
+
<div class="tags">
|
467
|
+
|
468
|
+
|
469
|
+
</div><table class="source_code">
|
470
|
+
<tr>
|
471
|
+
<td>
|
472
|
+
<pre class="lines">
|
473
|
+
|
474
|
+
|
475
|
+
31
|
476
|
+
32
|
477
|
+
33
|
478
|
+
34
|
479
|
+
35
|
480
|
+
36
|
481
|
+
37
|
482
|
+
38
|
483
|
+
39
|
484
|
+
40
|
485
|
+
41
|
486
|
+
42</pre>
|
487
|
+
</td>
|
488
|
+
<td>
|
489
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 31</span>
|
490
|
+
|
491
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span> <span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
492
|
+
|
493
|
+
<span class='kw'>if</span> <span class='ivar'>@tail</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='kw'>then</span>
|
494
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List/Node.html" title="List::Node (class)">Node</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="List#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
495
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='ivar'>@head</span>
|
496
|
+
<span class='kw'>else</span>
|
497
|
+
<span class='id identifier rubyid_temp'>temp</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List/Node.html" title="List::Node (class)">Node</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="List#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='ivar'>@tail</span><span class='rparen'>)</span>
|
498
|
+
<span class='ivar'>@tail</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span> <span class='op'>=</span> <span class='id identifier rubyid_temp'>temp</span>
|
499
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='id identifier rubyid_temp'>temp</span>
|
500
|
+
<span class='kw'>end</span>
|
501
|
+
|
502
|
+
<span class='kw'>end</span></pre>
|
503
|
+
</td>
|
504
|
+
</tr>
|
505
|
+
</table>
|
506
|
+
</div>
|
507
|
+
|
508
|
+
<div class="method_details ">
|
509
|
+
<h3 class="signature " id="addAll-instance_method">
|
510
|
+
|
511
|
+
#<strong>addAll</strong>(array) ⇒ <tt>Object</tt>
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
</h3><div class="docstring">
|
518
|
+
<div class="discussion">
|
519
|
+
|
520
|
+
<p>adds all elements in the given Array to our list. This works by calling the
|
521
|
+
add(value)-method for each element in the array</p>
|
522
|
+
|
523
|
+
|
524
|
+
</div>
|
525
|
+
</div>
|
526
|
+
<div class="tags">
|
527
|
+
|
528
|
+
|
529
|
+
</div><table class="source_code">
|
530
|
+
<tr>
|
531
|
+
<td>
|
532
|
+
<pre class="lines">
|
533
|
+
|
534
|
+
|
535
|
+
46
|
536
|
+
47
|
537
|
+
48
|
538
|
+
49
|
539
|
+
50</pre>
|
540
|
+
</td>
|
541
|
+
<td>
|
542
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 46</span>
|
543
|
+
|
544
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_addAll'>addAll</span> <span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='rparen'>)</span>
|
545
|
+
|
546
|
+
<span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
547
|
+
|
548
|
+
<span class='kw'>end</span></pre>
|
549
|
+
</td>
|
550
|
+
</tr>
|
551
|
+
</table>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
<div class="method_details ">
|
555
|
+
<h3 class="signature " id="each-instance_method">
|
556
|
+
|
557
|
+
#<strong>each</strong> ⇒ <tt>Object</tt>
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
</h3><div class="docstring">
|
564
|
+
<div class="discussion">
|
565
|
+
|
566
|
+
<p>this method is included because we implement the method Enumerable. Yields
|
567
|
+
every element in the list, one after another, by calling the to_a-method.</p>
|
568
|
+
|
569
|
+
|
570
|
+
</div>
|
571
|
+
</div>
|
572
|
+
<div class="tags">
|
573
|
+
|
574
|
+
|
575
|
+
</div><table class="source_code">
|
576
|
+
<tr>
|
577
|
+
<td>
|
578
|
+
<pre class="lines">
|
579
|
+
|
580
|
+
|
581
|
+
95
|
582
|
+
96
|
583
|
+
97</pre>
|
584
|
+
</td>
|
585
|
+
<td>
|
586
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 95</span>
|
587
|
+
|
588
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span>
|
589
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_i'>i</span> <span class='rbrace'>}</span>
|
590
|
+
<span class='kw'>end</span></pre>
|
591
|
+
</td>
|
592
|
+
</tr>
|
593
|
+
</table>
|
594
|
+
</div>
|
595
|
+
|
596
|
+
<div class="method_details ">
|
597
|
+
<h3 class="signature " id="getNode-instance_method">
|
598
|
+
|
599
|
+
#<strong>getNode</strong> ⇒ <tt>Object</tt>
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
</h3><div class="docstring">
|
606
|
+
<div class="discussion">
|
607
|
+
|
608
|
+
<p>returns the head-node</p>
|
609
|
+
|
610
|
+
|
611
|
+
</div>
|
612
|
+
</div>
|
613
|
+
<div class="tags">
|
614
|
+
|
615
|
+
|
616
|
+
</div><table class="source_code">
|
617
|
+
<tr>
|
618
|
+
<td>
|
619
|
+
<pre class="lines">
|
620
|
+
|
621
|
+
|
622
|
+
53
|
623
|
+
54
|
624
|
+
55
|
625
|
+
56
|
626
|
+
57</pre>
|
627
|
+
</td>
|
628
|
+
<td>
|
629
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 53</span>
|
630
|
+
|
631
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_getNode'>getNode</span>
|
632
|
+
|
633
|
+
<span class='ivar'>@head</span>
|
634
|
+
|
635
|
+
<span class='kw'>end</span></pre>
|
636
|
+
</td>
|
637
|
+
</tr>
|
638
|
+
</table>
|
639
|
+
</div>
|
640
|
+
|
641
|
+
<div class="method_details ">
|
642
|
+
<h3 class="signature " id="head-instance_method">
|
643
|
+
|
644
|
+
#<strong>head</strong> ⇒ <tt>Object</tt>
|
645
|
+
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
</h3><div class="docstring">
|
651
|
+
<div class="discussion">
|
652
|
+
|
653
|
+
<p>returns the value of the head</p>
|
654
|
+
|
655
|
+
|
656
|
+
</div>
|
657
|
+
</div>
|
658
|
+
<div class="tags">
|
659
|
+
|
660
|
+
|
661
|
+
</div><table class="source_code">
|
662
|
+
<tr>
|
663
|
+
<td>
|
664
|
+
<pre class="lines">
|
665
|
+
|
666
|
+
|
667
|
+
60
|
668
|
+
61
|
669
|
+
62</pre>
|
670
|
+
</td>
|
671
|
+
<td>
|
672
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 60</span>
|
673
|
+
|
674
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_head'>head</span>
|
675
|
+
<span class='ivar'>@head</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
|
676
|
+
<span class='kw'>end</span></pre>
|
677
|
+
</td>
|
678
|
+
</tr>
|
679
|
+
</table>
|
680
|
+
</div>
|
681
|
+
|
682
|
+
<div class="method_details ">
|
683
|
+
<h3 class="signature " id="isEmpty?-instance_method">
|
684
|
+
|
685
|
+
#<strong>isEmpty?</strong> ⇒ <tt>Boolean</tt>
|
686
|
+
|
687
|
+
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
</h3><div class="docstring">
|
692
|
+
<div class="discussion">
|
693
|
+
|
694
|
+
<p>returns true if the list is empty and false else</p>
|
695
|
+
|
696
|
+
|
697
|
+
</div>
|
698
|
+
</div>
|
699
|
+
<div class="tags">
|
700
|
+
|
701
|
+
<p class="tag_title">Returns:</p>
|
702
|
+
<ul class="return">
|
703
|
+
|
704
|
+
<li>
|
705
|
+
|
706
|
+
|
707
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
708
|
+
|
709
|
+
|
710
|
+
|
711
|
+
</li>
|
712
|
+
|
713
|
+
</ul>
|
714
|
+
|
715
|
+
</div><table class="source_code">
|
716
|
+
<tr>
|
717
|
+
<td>
|
718
|
+
<pre class="lines">
|
719
|
+
|
720
|
+
|
721
|
+
21
|
722
|
+
22
|
723
|
+
23
|
724
|
+
24
|
725
|
+
25
|
726
|
+
26
|
727
|
+
27</pre>
|
728
|
+
</td>
|
729
|
+
<td>
|
730
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 21</span>
|
731
|
+
|
732
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_isEmpty?'>isEmpty?</span>
|
733
|
+
<span class='kw'>if</span> <span class='ivar'>@head</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='kw'>then</span>
|
734
|
+
<span class='kw'>true</span>
|
735
|
+
<span class='kw'>else</span>
|
736
|
+
<span class='kw'>false</span>
|
737
|
+
<span class='kw'>end</span>
|
738
|
+
<span class='kw'>end</span></pre>
|
739
|
+
</td>
|
740
|
+
</tr>
|
741
|
+
</table>
|
742
|
+
</div>
|
743
|
+
|
744
|
+
<div class="method_details ">
|
745
|
+
<h3 class="signature " id="tail-instance_method">
|
746
|
+
|
747
|
+
#<strong>tail</strong> ⇒ <tt>Object</tt>
|
748
|
+
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
</h3><div class="docstring">
|
754
|
+
<div class="discussion">
|
755
|
+
|
756
|
+
<p>returns the value of the tail</p>
|
757
|
+
|
758
|
+
|
759
|
+
</div>
|
760
|
+
</div>
|
761
|
+
<div class="tags">
|
762
|
+
|
763
|
+
|
764
|
+
</div><table class="source_code">
|
765
|
+
<tr>
|
766
|
+
<td>
|
767
|
+
<pre class="lines">
|
768
|
+
|
769
|
+
|
770
|
+
65
|
771
|
+
66
|
772
|
+
67</pre>
|
773
|
+
</td>
|
774
|
+
<td>
|
775
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 65</span>
|
776
|
+
|
777
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_tail'>tail</span>
|
778
|
+
<span class='ivar'>@tail</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
|
779
|
+
<span class='kw'>end</span></pre>
|
780
|
+
</td>
|
781
|
+
</tr>
|
782
|
+
</table>
|
783
|
+
</div>
|
784
|
+
|
785
|
+
<div class="method_details ">
|
786
|
+
<h3 class="signature " id="to_a-instance_method">
|
787
|
+
|
788
|
+
#<strong>to_a</strong> ⇒ <tt>Object</tt>
|
789
|
+
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
|
794
|
+
</h3><div class="docstring">
|
795
|
+
<div class="discussion">
|
796
|
+
|
797
|
+
<p>returns an array with all the values of this list</p>
|
798
|
+
|
799
|
+
|
800
|
+
</div>
|
801
|
+
</div>
|
802
|
+
<div class="tags">
|
803
|
+
|
804
|
+
|
805
|
+
</div><table class="source_code">
|
806
|
+
<tr>
|
807
|
+
<td>
|
808
|
+
<pre class="lines">
|
809
|
+
|
810
|
+
|
811
|
+
70
|
812
|
+
71
|
813
|
+
72
|
814
|
+
73
|
815
|
+
74
|
816
|
+
75
|
817
|
+
76
|
818
|
+
77
|
819
|
+
78</pre>
|
820
|
+
</td>
|
821
|
+
<td>
|
822
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 70</span>
|
823
|
+
|
824
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_a'>to_a</span>
|
825
|
+
<span class='id identifier rubyid_tempArray'>tempArray</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
826
|
+
<span class='id identifier rubyid_tempNode'>tempNode</span> <span class='op'>=</span> <span class='ivar'>@head</span>
|
827
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_tempNode'>tempNode</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>do</span>
|
828
|
+
<span class='id identifier rubyid_tempArray'>tempArray</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_tempNode'>tempNode</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
829
|
+
<span class='id identifier rubyid_tempNode'>tempNode</span> <span class='op'>=</span> <span class='id identifier rubyid_tempNode'>tempNode</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span>
|
830
|
+
<span class='kw'>end</span>
|
831
|
+
<span class='id identifier rubyid_tempArray'>tempArray</span>
|
832
|
+
<span class='kw'>end</span></pre>
|
833
|
+
</td>
|
834
|
+
</tr>
|
835
|
+
</table>
|
836
|
+
</div>
|
837
|
+
|
838
|
+
<div class="method_details ">
|
839
|
+
<h3 class="signature " id="to_a_reverse-instance_method">
|
840
|
+
|
841
|
+
#<strong>to_a_reverse</strong> ⇒ <tt>Object</tt>
|
842
|
+
|
843
|
+
|
844
|
+
|
845
|
+
|
846
|
+
|
847
|
+
</h3><div class="docstring">
|
848
|
+
<div class="discussion">
|
849
|
+
|
850
|
+
<p>returns an array with all the values of this list, but in a reverse order</p>
|
851
|
+
|
852
|
+
|
853
|
+
</div>
|
854
|
+
</div>
|
855
|
+
<div class="tags">
|
856
|
+
|
857
|
+
|
858
|
+
</div><table class="source_code">
|
859
|
+
<tr>
|
860
|
+
<td>
|
861
|
+
<pre class="lines">
|
862
|
+
|
863
|
+
|
864
|
+
82
|
865
|
+
83
|
866
|
+
84
|
867
|
+
85
|
868
|
+
86
|
869
|
+
87
|
870
|
+
88
|
871
|
+
89
|
872
|
+
90</pre>
|
873
|
+
</td>
|
874
|
+
<td>
|
875
|
+
<pre class="code"><span class="info file"># File 'lib/list.rb', line 82</span>
|
876
|
+
|
877
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_a_reverse'>to_a_reverse</span>
|
878
|
+
<span class='id identifier rubyid_tempArray'>tempArray</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
879
|
+
<span class='id identifier rubyid_tempNode'>tempNode</span> <span class='op'>=</span> <span class='ivar'>@tail</span>
|
880
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_tempNode'>tempNode</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>do</span>
|
881
|
+
<span class='id identifier rubyid_tempArray'>tempArray</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_tempNode'>tempNode</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
882
|
+
<span class='id identifier rubyid_tempNode'>tempNode</span> <span class='op'>=</span> <span class='id identifier rubyid_tempNode'>tempNode</span><span class='period'>.</span><span class='id identifier rubyid_prev'>prev</span>
|
883
|
+
<span class='kw'>end</span>
|
884
|
+
<span class='id identifier rubyid_tempArray'>tempArray</span>
|
885
|
+
<span class='kw'>end</span></pre>
|
886
|
+
</td>
|
887
|
+
</tr>
|
888
|
+
</table>
|
889
|
+
</div>
|
890
|
+
|
891
|
+
</div>
|
892
|
+
|
893
|
+
</div>
|
894
|
+
|
895
|
+
<div id="footer">
|
896
|
+
Generated on Wed Nov 15 00:31:53 2017 by
|
897
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
898
|
+
0.9.9 (ruby-2.3.0).
|
899
|
+
</div>
|
900
|
+
|
901
|
+
</div>
|
902
|
+
</body>
|
903
|
+
</html>
|