LPP_alu0100966589 0.1.1
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/.coveralls.yml +1 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +20 -0
- data/Rakefile +6 -0
- data/TDD.gemspec +41 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Array.html +355 -0
- data/docs/CarbohydrateRich.html +152 -0
- data/docs/Dll.html +845 -0
- data/docs/DllNode.html +418 -0
- data/docs/EggMilkAndDerivatives.html +152 -0
- data/docs/Fish.html +152 -0
- data/docs/Food.html +1500 -0
- data/docs/Fruits.html +152 -0
- data/docs/MeatAndDerivatives.html +152 -0
- data/docs/OilsAndSweets.html +152 -0
- data/docs/TDD.html +117 -0
- data/docs/Vegetables.html +152 -0
- data/docs/_index.html +229 -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 +499 -0
- data/docs/file.README.html +109 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +109 -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 +251 -0
- data/docs/top-level-namespace.html +112 -0
- data/lib/TDD.rb +12 -0
- data/lib/TDD/Dll.rb +80 -0
- data/lib/TDD/DllNode.rb +3 -0
- data/lib/TDD/Food.rb +110 -0
- data/lib/TDD/FoodPyramidClasses.rb +20 -0
- data/lib/TDD/Plate.rb +124 -0
- data/lib/TDD/sort.rb +35 -0
- data/lib/TDD/version.rb +3 -0
- metadata +203 -0
@@ -0,0 +1,152 @@
|
|
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: CarbohydrateRich
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.12
|
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 = "CarbohydrateRich";
|
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 (C)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">CarbohydrateRich</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: CarbohydrateRich
|
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="Food.html" title="Food (class)">Food</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next"><span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></li>
|
78
|
+
|
79
|
+
<li class="next">CarbohydrateRich</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/TDD/FoodPyramidClasses.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<h2>Constant Summary</h2>
|
108
|
+
|
109
|
+
<h3 class="inherited">Constants inherited
|
110
|
+
from <span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></h3>
|
111
|
+
<p class="inherited"><span class='object_link'><a href="Food.html#DELTA_TIME-constant" title="Food::DELTA_TIME (constant)">Food::DELTA_TIME</a></span></p>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<h2>Instance Attribute Summary</h2>
|
117
|
+
|
118
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></h3>
|
119
|
+
<p class="inherited"><span class='object_link'><a href="Food.html#energetic_value-instance_method" title="Food#energetic_value (method)">#energetic_value</a></span>, <span class='object_link'><a href="Food.html#glycemic_index-instance_method" title="Food#glycemic_index (method)">#glycemic_index</a></span>, <span class='object_link'><a href="Food.html#name-instance_method" title="Food#name (method)">#name</a></span>, <span class='object_link'><a href="Food.html#nutrient_quantities-instance_method" title="Food#nutrient_quantities (method)">#nutrient_quantities</a></span></p>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<h2>Method Summary</h2>
|
130
|
+
|
131
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></h3>
|
132
|
+
<p class="inherited"><span class='object_link'><a href="Food.html#<=>-instance_method" title="Food#<=> (method)">#<=></a></span>, <span class='object_link'><a href="Food.html#gi-instance_method" title="Food#gi (method)">#gi</a></span>, <span class='object_link'><a href="Food.html#iauc-instance_method" title="Food#iauc (method)">#iauc</a></span>, <span class='object_link'><a href="Food.html#individual_gi-instance_method" title="Food#individual_gi (method)">#individual_gi</a></span>, <span class='object_link'><a href="Food.html#initialize-instance_method" title="Food#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Food.html#nutrients_name-class_method" title="Food.nutrients_name (method)">nutrients_name</a></span>, <span class='object_link'><a href="Food.html#quantity_of_nutrient-instance_method" title="Food#quantity_of_nutrient (method)">#quantity_of_nutrient</a></span>, <span class='object_link'><a href="Food.html#to_s-instance_method" title="Food#to_s (method)">#to_s</a></span></p>
|
133
|
+
|
134
|
+
<div id="constructor_details" class="method_details_list">
|
135
|
+
<h2>Constructor Details</h2>
|
136
|
+
|
137
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Food.html#initialize-instance_method" title="Food#initialize (method)">Food</a></span></p>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<div id="footer">
|
145
|
+
Generated on Tue Nov 28 21:26:18 2017 by
|
146
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
147
|
+
0.9.12 (ruby-2.3.0).
|
148
|
+
</div>
|
149
|
+
|
150
|
+
</div>
|
151
|
+
</body>
|
152
|
+
</html>
|
data/docs/Dll.html
ADDED
@@ -0,0 +1,845 @@
|
|
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: Dll
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.12
|
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 = "Dll";
|
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 (D)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Dll</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: Dll
|
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">Dll</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/TDD/Dll.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
112
|
+
<ul class="summary">
|
113
|
+
|
114
|
+
<li class="public ">
|
115
|
+
<span class="summary_signature">
|
116
|
+
|
117
|
+
<a href="#head-instance_method" title="#head (instance method)">#<strong>head</strong> ⇒ DllNode </a>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
</span>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<span class="note title readonly">readonly</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'>
|
137
|
+
<p>Getter for the head node.</p>
|
138
|
+
</div></span>
|
139
|
+
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li class="public ">
|
144
|
+
<span class="summary_signature">
|
145
|
+
|
146
|
+
<a href="#tail-instance_method" title="#tail (instance method)">#<strong>tail</strong> ⇒ DllNode </a>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
</span>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<span class="note title readonly">readonly</span>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
<span class="summary_desc"><div class='inline'>
|
166
|
+
<p>Getter for the tail node.</p>
|
167
|
+
</div></span>
|
168
|
+
|
169
|
+
</li>
|
170
|
+
|
171
|
+
|
172
|
+
</ul>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<h2>
|
179
|
+
Instance Method Summary
|
180
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
181
|
+
</h2>
|
182
|
+
|
183
|
+
<ul class="summary">
|
184
|
+
|
185
|
+
<li class="public ">
|
186
|
+
<span class="summary_signature">
|
187
|
+
|
188
|
+
<a href="#each-instance_method" title="#each (instance method)">#<strong>each</strong> ⇒ Object </a>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
</span>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<span class="summary_desc"><div class='inline'>
|
203
|
+
<p>Iterates over the list and yields for each item.</p>
|
204
|
+
</div></span>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
|
209
|
+
<li class="public ">
|
210
|
+
<span class="summary_signature">
|
211
|
+
|
212
|
+
<a href="#extract_head-instance_method" title="#extract_head (instance method)">#<strong>extract_head</strong> ⇒ Object </a>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</span>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<span class="summary_desc"><div class='inline'>
|
227
|
+
<p>Deletes the first element on the list.</p>
|
228
|
+
</div></span>
|
229
|
+
|
230
|
+
</li>
|
231
|
+
|
232
|
+
|
233
|
+
<li class="public ">
|
234
|
+
<span class="summary_signature">
|
235
|
+
|
236
|
+
<a href="#extract_tail-instance_method" title="#extract_tail (instance method)">#<strong>extract_tail</strong> ⇒ Object </a>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</span>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<span class="summary_desc"><div class='inline'>
|
251
|
+
<p>Deletes the last element on the list.</p>
|
252
|
+
</div></span>
|
253
|
+
|
254
|
+
</li>
|
255
|
+
|
256
|
+
|
257
|
+
<li class="public ">
|
258
|
+
<span class="summary_signature">
|
259
|
+
|
260
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Dll </a>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</span>
|
265
|
+
|
266
|
+
|
267
|
+
<span class="note title constructor">constructor</span>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
<span class="summary_desc"><div class='inline'>
|
277
|
+
<p>Initializes to an empty list.</p>
|
278
|
+
</div></span>
|
279
|
+
|
280
|
+
</li>
|
281
|
+
|
282
|
+
|
283
|
+
<li class="public ">
|
284
|
+
<span class="summary_signature">
|
285
|
+
|
286
|
+
<a href="#insert_head-instance_method" title="#insert_head (instance method)">#<strong>insert_head</strong>(value) ⇒ Object </a>
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
</span>
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
<span class="summary_desc"><div class='inline'>
|
301
|
+
<p>Insert a new value, having it be the first on the list.</p>
|
302
|
+
</div></span>
|
303
|
+
|
304
|
+
</li>
|
305
|
+
|
306
|
+
|
307
|
+
<li class="public ">
|
308
|
+
<span class="summary_signature">
|
309
|
+
|
310
|
+
<a href="#insert_tail-instance_method" title="#insert_tail (instance method)">#<strong>insert_tail</strong>(value) ⇒ Object </a>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</span>
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
<span class="summary_desc"><div class='inline'>
|
325
|
+
<p>Insert a new value, having it be the last on the list.</p>
|
326
|
+
</div></span>
|
327
|
+
|
328
|
+
</li>
|
329
|
+
|
330
|
+
|
331
|
+
</ul>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
<div id="constructor_details" class="method_details_list">
|
336
|
+
<h2>Constructor Details</h2>
|
337
|
+
|
338
|
+
<div class="method_details first">
|
339
|
+
<h3 class="signature first" id="initialize-instance_method">
|
340
|
+
|
341
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Dll (class)">Dll</a></span></tt>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
</h3><div class="docstring">
|
348
|
+
<div class="discussion">
|
349
|
+
|
350
|
+
<p>Initializes to an empty list</p>
|
351
|
+
|
352
|
+
|
353
|
+
</div>
|
354
|
+
</div>
|
355
|
+
<div class="tags">
|
356
|
+
|
357
|
+
|
358
|
+
</div><table class="source_code">
|
359
|
+
<tr>
|
360
|
+
<td>
|
361
|
+
<pre class="lines">
|
362
|
+
|
363
|
+
|
364
|
+
13
|
365
|
+
14
|
366
|
+
15
|
367
|
+
16</pre>
|
368
|
+
</td>
|
369
|
+
<td>
|
370
|
+
<pre class="code"><span class="info file"># File 'lib/TDD/Dll.rb', line 13</span>
|
371
|
+
|
372
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
373
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
374
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
375
|
+
<span class='kw'>end</span></pre>
|
376
|
+
</td>
|
377
|
+
</tr>
|
378
|
+
</table>
|
379
|
+
</div>
|
380
|
+
|
381
|
+
</div>
|
382
|
+
|
383
|
+
<div id="instance_attr_details" class="attr_details">
|
384
|
+
<h2>Instance Attribute Details</h2>
|
385
|
+
|
386
|
+
|
387
|
+
<span id=""></span>
|
388
|
+
<div class="method_details first">
|
389
|
+
<h3 class="signature first" id="head-instance_method">
|
390
|
+
|
391
|
+
#<strong>head</strong> ⇒ <tt><span class='object_link'><a href="DllNode.html" title="DllNode (class)">DllNode</a></span></tt> <span class="extras">(readonly)</span>
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
</h3><div class="docstring">
|
398
|
+
<div class="discussion">
|
399
|
+
|
400
|
+
<p>Getter for the head node</p>
|
401
|
+
|
402
|
+
|
403
|
+
</div>
|
404
|
+
</div>
|
405
|
+
<div class="tags">
|
406
|
+
|
407
|
+
<p class="tag_title">Returns:</p>
|
408
|
+
<ul class="return">
|
409
|
+
|
410
|
+
<li>
|
411
|
+
|
412
|
+
|
413
|
+
<span class='type'>(<tt><span class='object_link'><a href="DllNode.html" title="DllNode (class)">DllNode</a></span></tt>)</span>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
—
|
418
|
+
<div class='inline'>
|
419
|
+
<p>The first node on the list or nil if there is none</p>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
</li>
|
423
|
+
|
424
|
+
</ul>
|
425
|
+
|
426
|
+
</div><table class="source_code">
|
427
|
+
<tr>
|
428
|
+
<td>
|
429
|
+
<pre class="lines">
|
430
|
+
|
431
|
+
|
432
|
+
6
|
433
|
+
7
|
434
|
+
8</pre>
|
435
|
+
</td>
|
436
|
+
<td>
|
437
|
+
<pre class="code"><span class="info file"># File 'lib/TDD/Dll.rb', line 6</span>
|
438
|
+
|
439
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_head'>head</span>
|
440
|
+
<span class='ivar'>@head</span>
|
441
|
+
<span class='kw'>end</span></pre>
|
442
|
+
</td>
|
443
|
+
</tr>
|
444
|
+
</table>
|
445
|
+
</div>
|
446
|
+
|
447
|
+
|
448
|
+
<span id=""></span>
|
449
|
+
<div class="method_details ">
|
450
|
+
<h3 class="signature " id="tail-instance_method">
|
451
|
+
|
452
|
+
#<strong>tail</strong> ⇒ <tt><span class='object_link'><a href="DllNode.html" title="DllNode (class)">DllNode</a></span></tt> <span class="extras">(readonly)</span>
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
</h3><div class="docstring">
|
459
|
+
<div class="discussion">
|
460
|
+
|
461
|
+
<p>Getter for the tail node</p>
|
462
|
+
|
463
|
+
|
464
|
+
</div>
|
465
|
+
</div>
|
466
|
+
<div class="tags">
|
467
|
+
|
468
|
+
<p class="tag_title">Returns:</p>
|
469
|
+
<ul class="return">
|
470
|
+
|
471
|
+
<li>
|
472
|
+
|
473
|
+
|
474
|
+
<span class='type'>(<tt><span class='object_link'><a href="DllNode.html" title="DllNode (class)">DllNode</a></span></tt>)</span>
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
—
|
479
|
+
<div class='inline'>
|
480
|
+
<p>The last node on the list or nil if there is none</p>
|
481
|
+
</div>
|
482
|
+
|
483
|
+
</li>
|
484
|
+
|
485
|
+
</ul>
|
486
|
+
|
487
|
+
</div><table class="source_code">
|
488
|
+
<tr>
|
489
|
+
<td>
|
490
|
+
<pre class="lines">
|
491
|
+
|
492
|
+
|
493
|
+
10
|
494
|
+
11
|
495
|
+
12</pre>
|
496
|
+
</td>
|
497
|
+
<td>
|
498
|
+
<pre class="code"><span class="info file"># File 'lib/TDD/Dll.rb', line 10</span>
|
499
|
+
|
500
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_tail'>tail</span>
|
501
|
+
<span class='ivar'>@tail</span>
|
502
|
+
<span class='kw'>end</span></pre>
|
503
|
+
</td>
|
504
|
+
</tr>
|
505
|
+
</table>
|
506
|
+
</div>
|
507
|
+
|
508
|
+
</div>
|
509
|
+
|
510
|
+
|
511
|
+
<div id="instance_method_details" class="method_details_list">
|
512
|
+
<h2>Instance Method Details</h2>
|
513
|
+
|
514
|
+
|
515
|
+
<div class="method_details first">
|
516
|
+
<h3 class="signature first" id="each-instance_method">
|
517
|
+
|
518
|
+
#<strong>each</strong> ⇒ <tt>Object</tt>
|
519
|
+
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
</h3><div class="docstring">
|
525
|
+
<div class="discussion">
|
526
|
+
|
527
|
+
<p>Iterates over the list and yields for each item. The yield passes the value
|
528
|
+
of each element to the block</p>
|
529
|
+
|
530
|
+
|
531
|
+
</div>
|
532
|
+
</div>
|
533
|
+
<div class="tags">
|
534
|
+
|
535
|
+
|
536
|
+
</div><table class="source_code">
|
537
|
+
<tr>
|
538
|
+
<td>
|
539
|
+
<pre class="lines">
|
540
|
+
|
541
|
+
|
542
|
+
73
|
543
|
+
74
|
544
|
+
75
|
545
|
+
76
|
546
|
+
77
|
547
|
+
78
|
548
|
+
79</pre>
|
549
|
+
</td>
|
550
|
+
<td>
|
551
|
+
<pre class="code"><span class="info file"># File 'lib/TDD/Dll.rb', line 73</span>
|
552
|
+
|
553
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span>
|
554
|
+
<span class='id identifier rubyid_curr_node'>curr_node</span> <span class='op'>=</span> <span class='ivar'>@head</span>
|
555
|
+
<span class='kw'>while</span> <span class='lparen'>(</span><span class='id identifier rubyid_curr_node'>curr_node</span> <span class='op'>!=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
556
|
+
<span class='kw'>yield</span> <span class='id identifier rubyid_curr_node'>curr_node</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
|
557
|
+
<span class='id identifier rubyid_curr_node'>curr_node</span> <span class='op'>=</span> <span class='id identifier rubyid_curr_node'>curr_node</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span>
|
558
|
+
<span class='kw'>end</span>
|
559
|
+
<span class='kw'>end</span></pre>
|
560
|
+
</td>
|
561
|
+
</tr>
|
562
|
+
</table>
|
563
|
+
</div>
|
564
|
+
|
565
|
+
<div class="method_details ">
|
566
|
+
<h3 class="signature " id="extract_head-instance_method">
|
567
|
+
|
568
|
+
#<strong>extract_head</strong> ⇒ <tt>Object</tt>
|
569
|
+
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
</h3><div class="docstring">
|
575
|
+
<div class="discussion">
|
576
|
+
|
577
|
+
<p>Deletes the first element on the list</p>
|
578
|
+
|
579
|
+
|
580
|
+
</div>
|
581
|
+
</div>
|
582
|
+
<div class="tags">
|
583
|
+
|
584
|
+
|
585
|
+
</div><table class="source_code">
|
586
|
+
<tr>
|
587
|
+
<td>
|
588
|
+
<pre class="lines">
|
589
|
+
|
590
|
+
|
591
|
+
45
|
592
|
+
46
|
593
|
+
47
|
594
|
+
48
|
595
|
+
49
|
596
|
+
50
|
597
|
+
51
|
598
|
+
52
|
599
|
+
53
|
600
|
+
54
|
601
|
+
55
|
602
|
+
56</pre>
|
603
|
+
</td>
|
604
|
+
<td>
|
605
|
+
<pre class="code"><span class="info file"># File 'lib/TDD/Dll.rb', line 45</span>
|
606
|
+
|
607
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_head'>extract_head</span>
|
608
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='ivar'>@head</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
609
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='ivar'>@head</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
610
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
611
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
612
|
+
<span class='kw'>else</span>
|
613
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='ivar'>@head</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span>
|
614
|
+
<span class='ivar'>@head</span><span class='period'>.</span><span class='id identifier rubyid_prev'>prev</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
615
|
+
<span class='ivar'>@head</span><span class='period'>.</span><span class='id identifier rubyid_prev'>prev</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
616
|
+
<span class='kw'>end</span>
|
617
|
+
<span class='kw'>end</span>
|
618
|
+
<span class='kw'>end</span></pre>
|
619
|
+
</td>
|
620
|
+
</tr>
|
621
|
+
</table>
|
622
|
+
</div>
|
623
|
+
|
624
|
+
<div class="method_details ">
|
625
|
+
<h3 class="signature " id="extract_tail-instance_method">
|
626
|
+
|
627
|
+
#<strong>extract_tail</strong> ⇒ <tt>Object</tt>
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
</h3><div class="docstring">
|
634
|
+
<div class="discussion">
|
635
|
+
|
636
|
+
<p>Deletes the last element on the list</p>
|
637
|
+
|
638
|
+
|
639
|
+
</div>
|
640
|
+
</div>
|
641
|
+
<div class="tags">
|
642
|
+
|
643
|
+
|
644
|
+
</div><table class="source_code">
|
645
|
+
<tr>
|
646
|
+
<td>
|
647
|
+
<pre class="lines">
|
648
|
+
|
649
|
+
|
650
|
+
59
|
651
|
+
60
|
652
|
+
61
|
653
|
+
62
|
654
|
+
63
|
655
|
+
64
|
656
|
+
65
|
657
|
+
66
|
658
|
+
67
|
659
|
+
68
|
660
|
+
69
|
661
|
+
70</pre>
|
662
|
+
</td>
|
663
|
+
<td>
|
664
|
+
<pre class="code"><span class="info file"># File 'lib/TDD/Dll.rb', line 59</span>
|
665
|
+
|
666
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_tail'>extract_tail</span>
|
667
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='ivar'>@tail</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
668
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='ivar'>@tail</span><span class='period'>.</span><span class='id identifier rubyid_prev'>prev</span> <span class='op'>==</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
669
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
670
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
671
|
+
<span class='kw'>else</span>
|
672
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='ivar'>@tail</span><span class='period'>.</span><span class='id identifier rubyid_prev'>prev</span>
|
673
|
+
<span class='ivar'>@tail</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span><span class='period'>.</span><span class='id identifier rubyid_prev'>prev</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
674
|
+
<span class='ivar'>@tail</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
675
|
+
<span class='kw'>end</span>
|
676
|
+
<span class='kw'>end</span>
|
677
|
+
<span class='kw'>end</span></pre>
|
678
|
+
</td>
|
679
|
+
</tr>
|
680
|
+
</table>
|
681
|
+
</div>
|
682
|
+
|
683
|
+
<div class="method_details ">
|
684
|
+
<h3 class="signature " id="insert_head-instance_method">
|
685
|
+
|
686
|
+
#<strong>insert_head</strong>(value) ⇒ <tt>Object</tt>
|
687
|
+
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
|
692
|
+
</h3><div class="docstring">
|
693
|
+
<div class="discussion">
|
694
|
+
|
695
|
+
<p>Insert a new value, having it be the first on the list</p>
|
696
|
+
|
697
|
+
|
698
|
+
</div>
|
699
|
+
</div>
|
700
|
+
<div class="tags">
|
701
|
+
<p class="tag_title">Parameters:</p>
|
702
|
+
<ul class="param">
|
703
|
+
|
704
|
+
<li>
|
705
|
+
|
706
|
+
<span class='name'>value</span>
|
707
|
+
|
708
|
+
|
709
|
+
<span class='type'></span>
|
710
|
+
|
711
|
+
|
712
|
+
|
713
|
+
—
|
714
|
+
<div class='inline'>
|
715
|
+
<p>What you want to be inserted to the list</p>
|
716
|
+
</div>
|
717
|
+
|
718
|
+
</li>
|
719
|
+
|
720
|
+
</ul>
|
721
|
+
|
722
|
+
|
723
|
+
</div><table class="source_code">
|
724
|
+
<tr>
|
725
|
+
<td>
|
726
|
+
<pre class="lines">
|
727
|
+
|
728
|
+
|
729
|
+
20
|
730
|
+
21
|
731
|
+
22
|
732
|
+
23
|
733
|
+
24
|
734
|
+
25
|
735
|
+
26
|
736
|
+
27
|
737
|
+
28
|
738
|
+
29</pre>
|
739
|
+
</td>
|
740
|
+
<td>
|
741
|
+
<pre class="code"><span class="info file"># File 'lib/TDD/Dll.rb', line 20</span>
|
742
|
+
|
743
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_insert_head'>insert_head</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
744
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='ivar'>@head</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
745
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DllNode.html" title="DllNode (class)">DllNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
746
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='ivar'>@head</span>
|
747
|
+
<span class='kw'>else</span>
|
748
|
+
<span class='id identifier rubyid_aux'>aux</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DllNode.html" title="DllNode (class)">DllNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='ivar'>@head</span> <span class='rparen'>)</span>
|
749
|
+
<span class='ivar'>@head</span><span class='period'>.</span><span class='id identifier rubyid_prev'>prev</span> <span class='op'>=</span> <span class='id identifier rubyid_aux'>aux</span>
|
750
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='id identifier rubyid_aux'>aux</span>
|
751
|
+
<span class='kw'>end</span>
|
752
|
+
<span class='kw'>end</span></pre>
|
753
|
+
</td>
|
754
|
+
</tr>
|
755
|
+
</table>
|
756
|
+
</div>
|
757
|
+
|
758
|
+
<div class="method_details ">
|
759
|
+
<h3 class="signature " id="insert_tail-instance_method">
|
760
|
+
|
761
|
+
#<strong>insert_tail</strong>(value) ⇒ <tt>Object</tt>
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
</h3><div class="docstring">
|
768
|
+
<div class="discussion">
|
769
|
+
|
770
|
+
<p>Insert a new value, having it be the last on the list</p>
|
771
|
+
|
772
|
+
|
773
|
+
</div>
|
774
|
+
</div>
|
775
|
+
<div class="tags">
|
776
|
+
<p class="tag_title">Parameters:</p>
|
777
|
+
<ul class="param">
|
778
|
+
|
779
|
+
<li>
|
780
|
+
|
781
|
+
<span class='name'>value</span>
|
782
|
+
|
783
|
+
|
784
|
+
<span class='type'></span>
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
—
|
789
|
+
<div class='inline'>
|
790
|
+
<p>What you want to be inserted to the list</p>
|
791
|
+
</div>
|
792
|
+
|
793
|
+
</li>
|
794
|
+
|
795
|
+
</ul>
|
796
|
+
|
797
|
+
|
798
|
+
</div><table class="source_code">
|
799
|
+
<tr>
|
800
|
+
<td>
|
801
|
+
<pre class="lines">
|
802
|
+
|
803
|
+
|
804
|
+
33
|
805
|
+
34
|
806
|
+
35
|
807
|
+
36
|
808
|
+
37
|
809
|
+
38
|
810
|
+
39
|
811
|
+
40
|
812
|
+
41
|
813
|
+
42</pre>
|
814
|
+
</td>
|
815
|
+
<td>
|
816
|
+
<pre class="code"><span class="info file"># File 'lib/TDD/Dll.rb', line 33</span>
|
817
|
+
|
818
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_insert_tail'>insert_tail</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
819
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='ivar'>@tail</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
820
|
+
<span class='ivar'>@head</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DllNode.html" title="DllNode (class)">DllNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
821
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='ivar'>@head</span>
|
822
|
+
<span class='kw'>else</span>
|
823
|
+
<span class='id identifier rubyid_aux'>aux</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DllNode.html" title="DllNode (class)">DllNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='ivar'>@tail</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
824
|
+
<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_aux'>aux</span>
|
825
|
+
<span class='ivar'>@tail</span> <span class='op'>=</span> <span class='id identifier rubyid_aux'>aux</span>
|
826
|
+
<span class='kw'>end</span>
|
827
|
+
<span class='kw'>end</span></pre>
|
828
|
+
</td>
|
829
|
+
</tr>
|
830
|
+
</table>
|
831
|
+
</div>
|
832
|
+
|
833
|
+
</div>
|
834
|
+
|
835
|
+
</div>
|
836
|
+
|
837
|
+
<div id="footer">
|
838
|
+
Generated on Tue Nov 28 21:26:18 2017 by
|
839
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
840
|
+
0.9.12 (ruby-2.3.0).
|
841
|
+
</div>
|
842
|
+
|
843
|
+
</div>
|
844
|
+
</body>
|
845
|
+
</html>
|