dieta_alu0100648782 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +9 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +47 -0
- data/Rakefile +6 -0
- data/bat +122 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/dieta.gemspec +39 -0
- data/doc/CODE_OF_CONDUCT_md.html +197 -0
- data/doc/Dieta.html +109 -0
- data/doc/Dietas.html +219 -0
- data/doc/Gemfile.html +109 -0
- data/doc/Gemfile_lock.html +184 -0
- data/doc/Grupo_alimento.html +221 -0
- data/doc/Grupo_edad.html +221 -0
- data/doc/Guardfile.html +182 -0
- data/doc/LICENSE_txt.html +119 -0
- data/doc/Lista.html +457 -0
- data/doc/Menu.html +624 -0
- data/doc/Object.html +116 -0
- data/doc/Plato.html +314 -0
- data/doc/README_md.html +175 -0
- data/doc/Rakefile.html +103 -0
- data/doc/bat.html +224 -0
- data/doc/bin/setup.html +103 -0
- data/doc/created.rid +20 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +590 -0
- data/doc/dieta_gemspec.html +137 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +121 -0
- data/doc/js/darkfish.js +161 -0
- data/doc/js/jquery.js +4 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +228 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +260 -0
- data/lib/dieta/dietas.rb +11 -0
- data/lib/dieta/dsl.rb +59 -0
- data/lib/dieta/lista.rb +66 -0
- data/lib/dieta/menu.rb +79 -0
- data/lib/dieta/plato.rb +19 -0
- data/lib/dieta/version.rb +3 -0
- data/lib/dieta.rb +10 -0
- metadata +211 -0
@@ -0,0 +1,119 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>LICENSE - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script src="./js/jquery.js"></script>
|
14
|
+
<script src="./js/darkfish.js"></script>
|
15
|
+
|
16
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
17
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<body id="top" role="document" class="file">
|
22
|
+
<nav role="navigation">
|
23
|
+
<div id="project-navigation">
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
25
|
+
<h2>
|
26
|
+
<a href="./index.html" rel="home">Home</a>
|
27
|
+
</h2>
|
28
|
+
|
29
|
+
<div id="table-of-contents-navigation">
|
30
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
31
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
32
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
38
|
+
<div id="search-field-wrapper">
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
46
|
+
aria-busy="false" aria-expanded="false"
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
48
|
+
</form>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<div id="project-metadata">
|
56
|
+
<div id="fileindex-section" class="nav-section">
|
57
|
+
<h3>Pages</h3>
|
58
|
+
|
59
|
+
<ul class="link-list">
|
60
|
+
|
61
|
+
<li><a href="./CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a>
|
62
|
+
|
63
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
64
|
+
|
65
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
66
|
+
|
67
|
+
<li><a href="./Guardfile.html">Guardfile</a>
|
68
|
+
|
69
|
+
<li><a href="./LICENSE_txt.html">LICENSE</a>
|
70
|
+
|
71
|
+
<li><a href="./README_md.html">README</a>
|
72
|
+
|
73
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
74
|
+
|
75
|
+
<li><a href="./bat.html">bat</a>
|
76
|
+
|
77
|
+
<li><a href="./bin/setup.html">setup</a>
|
78
|
+
|
79
|
+
<li><a href="./dieta_gemspec.html">dieta.gemspec</a>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
</nav>
|
86
|
+
|
87
|
+
<main role="main" aria-label="Page LICENSE.txt">
|
88
|
+
|
89
|
+
<p>The MIT License (MIT)</p>
|
90
|
+
|
91
|
+
<p>Copyright © 2016 Rafael Abadia</p>
|
92
|
+
|
93
|
+
<p>Permission is hereby granted, free of charge, to any person obtaining a
|
94
|
+
copy of this software and associated documentation files (the “Software”),
|
95
|
+
to deal in the Software without restriction, including without limitation
|
96
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
97
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
98
|
+
Software is furnished to do so, subject to the following conditions:</p>
|
99
|
+
|
100
|
+
<p>The above copyright notice and this permission notice shall be included in
|
101
|
+
all copies or substantial portions of the Software.</p>
|
102
|
+
|
103
|
+
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
104
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
105
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
106
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
107
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
108
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
109
|
+
DEALINGS IN THE SOFTWARE.</p>
|
110
|
+
</main>
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<footer id="validator-badges" role="contentinfo">
|
115
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
116
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
|
117
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
118
|
+
</footer>
|
119
|
+
|
data/doc/Lista.html
ADDED
@@ -0,0 +1,457 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Lista - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script src="./js/jquery.js"></script>
|
14
|
+
<script src="./js/darkfish.js"></script>
|
15
|
+
|
16
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
17
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<body id="top" role="document" class="class">
|
22
|
+
<nav role="navigation">
|
23
|
+
<div id="project-navigation">
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
25
|
+
<h2>
|
26
|
+
<a href="./index.html" rel="home">Home</a>
|
27
|
+
</h2>
|
28
|
+
|
29
|
+
<div id="table-of-contents-navigation">
|
30
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
31
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
32
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
38
|
+
<div id="search-field-wrapper">
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
46
|
+
aria-busy="false" aria-expanded="false"
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
48
|
+
</form>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<div id="class-metadata">
|
56
|
+
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
58
|
+
<h3>Parent</h3>
|
59
|
+
|
60
|
+
|
61
|
+
<p class="link"><a href="Object.html">Object</a>
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div id="includes-section" class="nav-section">
|
66
|
+
<h3>Included Modules</h3>
|
67
|
+
|
68
|
+
<ul class="link-list">
|
69
|
+
|
70
|
+
|
71
|
+
<li><span class="include">Enumerable</span>
|
72
|
+
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
<!-- Method Quickref -->
|
79
|
+
<div id="method-list-section" class="nav-section">
|
80
|
+
<h3>Methods</h3>
|
81
|
+
|
82
|
+
<ul class="link-list" role="directory">
|
83
|
+
|
84
|
+
<li ><a href="#method-c-new">::new</a>
|
85
|
+
|
86
|
+
<li ><a href="#method-i-each">#each</a>
|
87
|
+
|
88
|
+
<li ><a href="#method-i-extract">#extract</a>
|
89
|
+
|
90
|
+
<li ><a href="#method-i-extract_final">#extract_final</a>
|
91
|
+
|
92
|
+
<li ><a href="#method-i-insert">#insert</a>
|
93
|
+
|
94
|
+
<li ><a href="#method-i-insert_multiple">#insert_multiple</a>
|
95
|
+
|
96
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
97
|
+
|
98
|
+
</ul>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
</nav>
|
103
|
+
|
104
|
+
<main role="main" aria-labelledby="class-Lista">
|
105
|
+
<h1 id="class-Lista" class="class">
|
106
|
+
class Lista
|
107
|
+
</h1>
|
108
|
+
|
109
|
+
<section class="description">
|
110
|
+
|
111
|
+
</section>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<section class="attribute-method-details" class="method-section">
|
125
|
+
<header>
|
126
|
+
<h3>Attributes</h3>
|
127
|
+
</header>
|
128
|
+
|
129
|
+
|
130
|
+
<div id="attribute-i-cola" class="method-detail">
|
131
|
+
<div class="method-heading attribute-method-heading">
|
132
|
+
<span class="method-name">cola</span><span
|
133
|
+
class="attribute-access-type">[RW]</span>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<div class="method-description">
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<div id="attribute-i-head" class="method-detail">
|
144
|
+
<div class="method-heading attribute-method-heading">
|
145
|
+
<span class="method-name">head</span><span
|
146
|
+
class="attribute-access-type">[RW]</span>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div class="method-description">
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div id="attribute-i-nodo_actual" class="method-detail">
|
157
|
+
<div class="method-heading attribute-method-heading">
|
158
|
+
<span class="method-name">nodo_actual</span><span
|
159
|
+
class="attribute-access-type">[RW]</span>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div class="method-description">
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
</section>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
174
|
+
<header>
|
175
|
+
<h3>Public Class Methods</h3>
|
176
|
+
</header>
|
177
|
+
|
178
|
+
|
179
|
+
<div id="method-c-new" class="method-detail ">
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<span class="method-name">new</span><span
|
183
|
+
class="method-args">(head,cola)</span>
|
184
|
+
|
185
|
+
<span class="method-click-advice">click to toggle source</span>
|
186
|
+
|
187
|
+
</div>
|
188
|
+
|
189
|
+
|
190
|
+
<div class="method-description">
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<div class="method-source-code" id="new-source">
|
198
|
+
<pre><span class="ruby-comment"># File lib/dieta/lista.rb, line 9</span>
|
199
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">head</span>,<span class="ruby-identifier">cola</span>)
|
200
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-identifier">head</span>
|
201
|
+
<span class="ruby-ivar">@cola</span> = <span class="ruby-identifier">cola</span>
|
202
|
+
<span class="ruby-keyword">end</span></pre>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</div>
|
211
|
+
|
212
|
+
|
213
|
+
</section>
|
214
|
+
|
215
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
216
|
+
<header>
|
217
|
+
<h3>Public Instance Methods</h3>
|
218
|
+
</header>
|
219
|
+
|
220
|
+
|
221
|
+
<div id="method-i-each" class="method-detail ">
|
222
|
+
|
223
|
+
<div class="method-heading">
|
224
|
+
<span class="method-name">each</span><span
|
225
|
+
class="method-args">() { |value| ... }</span>
|
226
|
+
|
227
|
+
<span class="method-click-advice">click to toggle source</span>
|
228
|
+
|
229
|
+
</div>
|
230
|
+
|
231
|
+
|
232
|
+
<div class="method-description">
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<div class="method-source-code" id="each-source">
|
240
|
+
<pre><span class="ruby-comment"># File lib/dieta/lista.rb, line 51</span>
|
241
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>
|
242
|
+
<span class="ruby-keyword">while</span> <span class="ruby-ivar">@head</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@cola</span>
|
243
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">value</span>
|
244
|
+
<span class="ruby-ivar">@head</span>=<span class="ruby-ivar">@head</span>.<span class="ruby-identifier">prev</span>
|
245
|
+
<span class="ruby-keyword">end</span>
|
246
|
+
|
247
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@cola</span>
|
248
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
|
249
|
+
<span class="ruby-keyword">nil</span>
|
250
|
+
<span class="ruby-keyword">else</span>
|
251
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-ivar">@cola</span>.<span class="ruby-identifier">value</span>
|
252
|
+
<span class="ruby-keyword">end</span>
|
253
|
+
<span class="ruby-keyword">end</span>
|
254
|
+
<span class="ruby-keyword">end</span></pre>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
|
265
|
+
<div id="method-i-extract" class="method-detail ">
|
266
|
+
|
267
|
+
<div class="method-heading">
|
268
|
+
<span class="method-name">extract</span><span
|
269
|
+
class="method-args">()</span>
|
270
|
+
|
271
|
+
<span class="method-click-advice">click to toggle source</span>
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
<div class="method-description">
|
277
|
+
|
278
|
+
<p>eliminar el nodo y cambiar los valores al nodo anterior</p>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
<div class="method-source-code" id="extract-source">
|
284
|
+
<pre><span class="ruby-comment"># File lib/dieta/lista.rb, line 39</span>
|
285
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">extract</span>()
|
286
|
+
<span class="ruby-ivar">@cola</span>=<span class="ruby-ivar">@cola</span>.<span class="ruby-identifier">next</span>
|
287
|
+
<span class="ruby-keyword">end</span></pre>
|
288
|
+
</div>
|
289
|
+
|
290
|
+
</div>
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
</div>
|
296
|
+
|
297
|
+
|
298
|
+
<div id="method-i-extract_final" class="method-detail ">
|
299
|
+
|
300
|
+
<div class="method-heading">
|
301
|
+
<span class="method-name">extract_final</span><span
|
302
|
+
class="method-args">()</span>
|
303
|
+
|
304
|
+
<span class="method-click-advice">click to toggle source</span>
|
305
|
+
|
306
|
+
</div>
|
307
|
+
|
308
|
+
|
309
|
+
<div class="method-description">
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
<div class="method-source-code" id="extract_final-source">
|
317
|
+
<pre><span class="ruby-comment"># File lib/dieta/lista.rb, line 43</span>
|
318
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">extract_final</span>()
|
319
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">prev</span>
|
320
|
+
<span class="ruby-keyword">end</span></pre>
|
321
|
+
</div>
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
</div>
|
329
|
+
|
330
|
+
|
331
|
+
<div id="method-i-insert" class="method-detail ">
|
332
|
+
|
333
|
+
<div class="method-heading">
|
334
|
+
<span class="method-name">insert</span><span
|
335
|
+
class="method-args">(x)</span>
|
336
|
+
|
337
|
+
<span class="method-click-advice">click to toggle source</span>
|
338
|
+
|
339
|
+
</div>
|
340
|
+
|
341
|
+
|
342
|
+
<div class="method-description">
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
<div class="method-source-code" id="insert-source">
|
350
|
+
<pre><span class="ruby-comment"># File lib/dieta/lista.rb, line 14</span>
|
351
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert</span>(<span class="ruby-identifier">x</span>)
|
352
|
+
<span class="ruby-identifier">node</span> = <span class="ruby-constant">Nodo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">x</span>,<span class="ruby-keyword">nil</span>,<span class="ruby-keyword">nil</span>)
|
353
|
+
|
354
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span><span class="ruby-operator">==</span><span class="ruby-keyword">nil</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@cola</span><span class="ruby-operator">==</span><span class="ruby-keyword">nil</span>
|
355
|
+
<span class="ruby-identifier">node</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-ivar">@cola</span>
|
356
|
+
<span class="ruby-identifier">node</span>.<span class="ruby-identifier">next</span> = <span class="ruby-ivar">@head</span>
|
357
|
+
<span class="ruby-ivar">@nodo_actual</span> = <span class="ruby-identifier">node</span>
|
358
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-identifier">node</span>
|
359
|
+
<span class="ruby-ivar">@cola</span> = <span class="ruby-identifier">node</span>
|
360
|
+
<span class="ruby-keyword">else</span>
|
361
|
+
<span class="ruby-identifier">node</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-ivar">@head</span>
|
362
|
+
<span class="ruby-identifier">node</span>.<span class="ruby-identifier">next</span> = <span class="ruby-keyword">nil</span>
|
363
|
+
<span class="ruby-ivar">@nodo_actual</span> = <span class="ruby-identifier">node</span>
|
364
|
+
<span class="ruby-ivar">@head</span>.<span class="ruby-identifier">next</span> = <span class="ruby-identifier">node</span>
|
365
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-identifier">node</span>
|
366
|
+
<span class="ruby-keyword">end</span>
|
367
|
+
<span class="ruby-keyword">end</span></pre>
|
368
|
+
</div>
|
369
|
+
|
370
|
+
</div>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
</div>
|
376
|
+
|
377
|
+
|
378
|
+
<div id="method-i-insert_multiple" class="method-detail ">
|
379
|
+
|
380
|
+
<div class="method-heading">
|
381
|
+
<span class="method-name">insert_multiple</span><span
|
382
|
+
class="method-args">(nodos)</span>
|
383
|
+
|
384
|
+
<span class="method-click-advice">click to toggle source</span>
|
385
|
+
|
386
|
+
</div>
|
387
|
+
|
388
|
+
|
389
|
+
<div class="method-description">
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
<div class="method-source-code" id="insert_multiple-source">
|
397
|
+
<pre><span class="ruby-comment"># File lib/dieta/lista.rb, line 32</span>
|
398
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert_multiple</span>(<span class="ruby-identifier">nodos</span>)
|
399
|
+
<span class="ruby-identifier">nodos</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">nd</span><span class="ruby-operator">|</span>
|
400
|
+
<span class="ruby-identifier">insert</span>(<span class="ruby-identifier">nd</span>)
|
401
|
+
<span class="ruby-keyword">end</span>
|
402
|
+
<span class="ruby-keyword">end</span></pre>
|
403
|
+
</div>
|
404
|
+
|
405
|
+
</div>
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
</div>
|
411
|
+
|
412
|
+
|
413
|
+
<div id="method-i-to_s" class="method-detail ">
|
414
|
+
|
415
|
+
<div class="method-heading">
|
416
|
+
<span class="method-name">to_s</span><span
|
417
|
+
class="method-args">()</span>
|
418
|
+
|
419
|
+
<span class="method-click-advice">click to toggle source</span>
|
420
|
+
|
421
|
+
</div>
|
422
|
+
|
423
|
+
|
424
|
+
<div class="method-description">
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
<div class="method-source-code" id="to_s-source">
|
432
|
+
<pre><span class="ruby-comment"># File lib/dieta/lista.rb, line 47</span>
|
433
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
434
|
+
<span class="ruby-ivar">@head</span>.<span class="ruby-identifier">to_s</span>
|
435
|
+
<span class="ruby-keyword">end</span></pre>
|
436
|
+
</div>
|
437
|
+
|
438
|
+
</div>
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
</div>
|
444
|
+
|
445
|
+
|
446
|
+
</section>
|
447
|
+
|
448
|
+
</section>
|
449
|
+
</main>
|
450
|
+
|
451
|
+
|
452
|
+
<footer id="validator-badges" role="contentinfo">
|
453
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
454
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
|
455
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
456
|
+
</footer>
|
457
|
+
|