alu0100974652-pract06 0.1.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/.coveralls.yml +1 -0
- data/.gitignore +11 -0
- data/.pract06.gemspec.swp +0 -0
- data/.rake_tasks~ +7 -0
- data/.rspec +3 -0
- data/.travis.yml +12 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +95 -0
- data/Guardfile +82 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Alimento.html +1011 -0
- data/docs/List.html +798 -0
- data/docs/Node.html +409 -0
- data/docs/Plato.html +1034 -0
- data/docs/Plato_herencia.html +979 -0
- data/docs/Pract06.html +133 -0
- data/docs/Pract06/Error.html +124 -0
- data/docs/_index.html +171 -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 +496 -0
- data/docs/file.README.html +111 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +111 -0
- data/docs/js/app.js +303 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +387 -0
- data/docs/top-level-namespace.html +112 -0
- data/lib/pract06.rb +11 -0
- data/lib/pract06/list.rb +68 -0
- data/lib/pract06/menu.rb +33 -0
- data/lib/pract06/plato.rb +94 -0
- data/lib/pract06/plato_herencia.rb +129 -0
- data/lib/pract06/platodsl.rb +29 -0
- data/lib/pract06/pract06.rb +56 -0
- data/lib/pract06/version.rb +3 -0
- data/pract06.gemspec +33 -0
- metadata +173 -0
data/docs/Node.html
ADDED
@@ -0,0 +1,409 @@
|
|
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: Node
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.20
|
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 = "Node";
|
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 (N)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Node</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: Node
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Struct</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Struct</li>
|
78
|
+
|
79
|
+
<li class="next">Node</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/pract06/list.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Creación de la clase List con la estructura Node</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
120
|
+
<ul class="summary">
|
121
|
+
|
122
|
+
<li class="public ">
|
123
|
+
<span class="summary_signature">
|
124
|
+
|
125
|
+
<a href="#next-instance_method" title="#next (instance method)">#<strong>next</strong> ⇒ Object </a>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
</span>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
143
|
+
<p>Returns the value of attribute next.</p>
|
144
|
+
</div></span>
|
145
|
+
|
146
|
+
</li>
|
147
|
+
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
152
|
+
<a href="#prev-instance_method" title="#prev (instance method)">#<strong>prev</strong> ⇒ Object </a>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</span>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'>
|
170
|
+
<p>Returns the value of attribute prev.</p>
|
171
|
+
</div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
<li class="public ">
|
177
|
+
<span class="summary_signature">
|
178
|
+
|
179
|
+
<a href="#value-instance_method" title="#value (instance method)">#<strong>value</strong> ⇒ Object </a>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</span>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
<span class="summary_desc"><div class='inline'>
|
197
|
+
<p>Returns the value of attribute value.</p>
|
198
|
+
</div></span>
|
199
|
+
|
200
|
+
</li>
|
201
|
+
|
202
|
+
|
203
|
+
</ul>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<div id="instance_attr_details" class="attr_details">
|
211
|
+
<h2>Instance Attribute Details</h2>
|
212
|
+
|
213
|
+
|
214
|
+
<span id="next=-instance_method"></span>
|
215
|
+
<div class="method_details first">
|
216
|
+
<h3 class="signature first" id="next-instance_method">
|
217
|
+
|
218
|
+
#<strong>next</strong> ⇒ <tt>Object</tt>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</h3><div class="docstring">
|
225
|
+
<div class="discussion">
|
226
|
+
|
227
|
+
<p>Returns the value of attribute next</p>
|
228
|
+
|
229
|
+
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
<div class="tags">
|
233
|
+
|
234
|
+
<p class="tag_title">Returns:</p>
|
235
|
+
<ul class="return">
|
236
|
+
|
237
|
+
<li>
|
238
|
+
|
239
|
+
|
240
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
—
|
245
|
+
<div class='inline'>
|
246
|
+
<p>the current value of next</p>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
</li>
|
250
|
+
|
251
|
+
</ul>
|
252
|
+
|
253
|
+
</div><table class="source_code">
|
254
|
+
<tr>
|
255
|
+
<td>
|
256
|
+
<pre class="lines">
|
257
|
+
|
258
|
+
|
259
|
+
4
|
260
|
+
5
|
261
|
+
6</pre>
|
262
|
+
</td>
|
263
|
+
<td>
|
264
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/list.rb', line 4</span>
|
265
|
+
|
266
|
+
<span class='kw'>def</span> <span class='kw'>next</span>
|
267
|
+
<span class='ivar'>@next</span>
|
268
|
+
<span class='kw'>end</span></pre>
|
269
|
+
</td>
|
270
|
+
</tr>
|
271
|
+
</table>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
|
275
|
+
<span id="prev=-instance_method"></span>
|
276
|
+
<div class="method_details ">
|
277
|
+
<h3 class="signature " id="prev-instance_method">
|
278
|
+
|
279
|
+
#<strong>prev</strong> ⇒ <tt>Object</tt>
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
</h3><div class="docstring">
|
286
|
+
<div class="discussion">
|
287
|
+
|
288
|
+
<p>Returns the value of attribute prev</p>
|
289
|
+
|
290
|
+
|
291
|
+
</div>
|
292
|
+
</div>
|
293
|
+
<div class="tags">
|
294
|
+
|
295
|
+
<p class="tag_title">Returns:</p>
|
296
|
+
<ul class="return">
|
297
|
+
|
298
|
+
<li>
|
299
|
+
|
300
|
+
|
301
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
—
|
306
|
+
<div class='inline'>
|
307
|
+
<p>the current value of prev</p>
|
308
|
+
</div>
|
309
|
+
|
310
|
+
</li>
|
311
|
+
|
312
|
+
</ul>
|
313
|
+
|
314
|
+
</div><table class="source_code">
|
315
|
+
<tr>
|
316
|
+
<td>
|
317
|
+
<pre class="lines">
|
318
|
+
|
319
|
+
|
320
|
+
4
|
321
|
+
5
|
322
|
+
6</pre>
|
323
|
+
</td>
|
324
|
+
<td>
|
325
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/list.rb', line 4</span>
|
326
|
+
|
327
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_prev'>prev</span>
|
328
|
+
<span class='ivar'>@prev</span>
|
329
|
+
<span class='kw'>end</span></pre>
|
330
|
+
</td>
|
331
|
+
</tr>
|
332
|
+
</table>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
|
336
|
+
<span id="value=-instance_method"></span>
|
337
|
+
<div class="method_details ">
|
338
|
+
<h3 class="signature " id="value-instance_method">
|
339
|
+
|
340
|
+
#<strong>value</strong> ⇒ <tt>Object</tt>
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
</h3><div class="docstring">
|
347
|
+
<div class="discussion">
|
348
|
+
|
349
|
+
<p>Returns the value of attribute value</p>
|
350
|
+
|
351
|
+
|
352
|
+
</div>
|
353
|
+
</div>
|
354
|
+
<div class="tags">
|
355
|
+
|
356
|
+
<p class="tag_title">Returns:</p>
|
357
|
+
<ul class="return">
|
358
|
+
|
359
|
+
<li>
|
360
|
+
|
361
|
+
|
362
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
—
|
367
|
+
<div class='inline'>
|
368
|
+
<p>the current value of value</p>
|
369
|
+
</div>
|
370
|
+
|
371
|
+
</li>
|
372
|
+
|
373
|
+
</ul>
|
374
|
+
|
375
|
+
</div><table class="source_code">
|
376
|
+
<tr>
|
377
|
+
<td>
|
378
|
+
<pre class="lines">
|
379
|
+
|
380
|
+
|
381
|
+
4
|
382
|
+
5
|
383
|
+
6</pre>
|
384
|
+
</td>
|
385
|
+
<td>
|
386
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/list.rb', line 4</span>
|
387
|
+
|
388
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
|
389
|
+
<span class='ivar'>@value</span>
|
390
|
+
<span class='kw'>end</span></pre>
|
391
|
+
</td>
|
392
|
+
</tr>
|
393
|
+
</table>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
</div>
|
397
|
+
|
398
|
+
|
399
|
+
</div>
|
400
|
+
|
401
|
+
<div id="footer">
|
402
|
+
Generated on Wed Dec 18 17:08:16 2019 by
|
403
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
404
|
+
0.9.20 (ruby-2.6.3).
|
405
|
+
</div>
|
406
|
+
|
407
|
+
</div>
|
408
|
+
</body>
|
409
|
+
</html>
|
data/docs/Plato.html
ADDED
@@ -0,0 +1,1034 @@
|
|
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: Plato
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.20
|
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 = "Plato";
|
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 (P)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Plato</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: Plato
|
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">Plato</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/pract06/plato.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Implementación de la clase Plato</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div><div id="subclasses">
|
114
|
+
<h2>Direct Known Subclasses</h2>
|
115
|
+
<p class="children"><span class='object_link'><a href="Plato_herencia.html" title="Plato_herencia (class)">Plato_herencia</a></span></p>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
122
|
+
<ul class="summary">
|
123
|
+
|
124
|
+
<li class="public ">
|
125
|
+
<span class="summary_signature">
|
126
|
+
|
127
|
+
<a href="#cantidades_engramos-instance_method" title="#cantidades_engramos (instance method)">#<strong>cantidades_engramos</strong> ⇒ Object </a>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
</span>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<span class="summary_desc"><div class='inline'>
|
145
|
+
<p>Returns the value of attribute cantidades_engramos.</p>
|
146
|
+
</div></span>
|
147
|
+
|
148
|
+
</li>
|
149
|
+
|
150
|
+
|
151
|
+
<li class="public ">
|
152
|
+
<span class="summary_signature">
|
153
|
+
|
154
|
+
<a href="#cantidades_totales_engramos-instance_method" title="#cantidades_totales_engramos (instance method)">#<strong>cantidades_totales_engramos</strong> ⇒ Object </a>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
</span>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>Returns the value of attribute cantidades_totales_engramos.</p>
|
173
|
+
</div></span>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
|
177
|
+
|
178
|
+
<li class="public ">
|
179
|
+
<span class="summary_signature">
|
180
|
+
|
181
|
+
<a href="#conjunto_alimentos-instance_method" title="#conjunto_alimentos (instance method)">#<strong>conjunto_alimentos</strong> ⇒ Object </a>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</span>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<span class="summary_desc"><div class='inline'>
|
199
|
+
<p>Returns the value of attribute conjunto_alimentos.</p>
|
200
|
+
</div></span>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
|
205
|
+
<li class="public ">
|
206
|
+
<span class="summary_signature">
|
207
|
+
|
208
|
+
<a href="#nombre_plato-instance_method" title="#nombre_plato (instance method)">#<strong>nombre_plato</strong> ⇒ Object </a>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</span>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<span class="summary_desc"><div class='inline'>
|
226
|
+
<p>Returns the value of attribute nombre_plato.</p>
|
227
|
+
</div></span>
|
228
|
+
|
229
|
+
</li>
|
230
|
+
|
231
|
+
|
232
|
+
</ul>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
<h2>
|
239
|
+
Instance Method Summary
|
240
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
241
|
+
</h2>
|
242
|
+
|
243
|
+
<ul class="summary">
|
244
|
+
|
245
|
+
<li class="public ">
|
246
|
+
<span class="summary_signature">
|
247
|
+
|
248
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(nombre_plato, conjunto_alimentos, cantidades_engramos, cantidades_totales_engramos) ⇒ Plato </a>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
</span>
|
253
|
+
|
254
|
+
|
255
|
+
<span class="note title constructor">constructor</span>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
<span class="summary_desc"><div class='inline'>
|
265
|
+
<p>Método initialize.</p>
|
266
|
+
</div></span>
|
267
|
+
|
268
|
+
</li>
|
269
|
+
|
270
|
+
|
271
|
+
<li class="public deprecated">
|
272
|
+
<span class="summary_signature">
|
273
|
+
|
274
|
+
<a href="#porcentaje_carbohidratos-instance_method" title="#porcentaje_carbohidratos (instance method)">#<strong>porcentaje_carbohidratos</strong> ⇒ Object </a>
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
</span>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
<span class="deprecated note title">deprecated</span>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'>
|
289
|
+
<p>Sirve para hallar el porcentaje de carbohidratos de un plato</p>
|
290
|
+
</div></span>
|
291
|
+
|
292
|
+
</li>
|
293
|
+
|
294
|
+
|
295
|
+
<li class="public deprecated">
|
296
|
+
<span class="summary_signature">
|
297
|
+
|
298
|
+
<a href="#porcentaje_lipidos-instance_method" title="#porcentaje_lipidos (instance method)">#<strong>porcentaje_lipidos</strong> ⇒ Object </a>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
</span>
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
<span class="deprecated note title">deprecated</span>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'>
|
313
|
+
<p>Sirve para hallar el porcentaje de lipidos de un plato</p>
|
314
|
+
</div></span>
|
315
|
+
|
316
|
+
</li>
|
317
|
+
|
318
|
+
|
319
|
+
<li class="public deprecated">
|
320
|
+
<span class="summary_signature">
|
321
|
+
|
322
|
+
<a href="#porcentaje_proteinas-instance_method" title="#porcentaje_proteinas (instance method)">#<strong>porcentaje_proteinas</strong> ⇒ Object </a>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
</span>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
<span class="deprecated note title">deprecated</span>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'>
|
337
|
+
<p>Sirve para hallar el porcentaje total de proteinas del plato a tratar</p>
|
338
|
+
</div></span>
|
339
|
+
|
340
|
+
</li>
|
341
|
+
|
342
|
+
|
343
|
+
<li class="public deprecated">
|
344
|
+
<span class="summary_signature">
|
345
|
+
|
346
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> ⇒ Object </a>
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
</span>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
<span class="deprecated note title">deprecated</span>
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'>
|
361
|
+
<p>Sirve para dar el plato en su forma formateada</p>
|
362
|
+
</div></span>
|
363
|
+
|
364
|
+
</li>
|
365
|
+
|
366
|
+
|
367
|
+
<li class="public deprecated">
|
368
|
+
<span class="summary_signature">
|
369
|
+
|
370
|
+
<a href="#valor_calorico_total-instance_method" title="#valor_calorico_total (instance method)">#<strong>valor_calorico_total</strong> ⇒ Object </a>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
</span>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
<span class="deprecated note title">deprecated</span>
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
<span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'>
|
385
|
+
<p>Sirve para hallar el valor calorico total del plato</p>
|
386
|
+
</div></span>
|
387
|
+
|
388
|
+
</li>
|
389
|
+
|
390
|
+
|
391
|
+
</ul>
|
392
|
+
|
393
|
+
|
394
|
+
<div id="constructor_details" class="method_details_list">
|
395
|
+
<h2>Constructor Details</h2>
|
396
|
+
|
397
|
+
<div class="method_details first">
|
398
|
+
<h3 class="signature first" id="initialize-instance_method">
|
399
|
+
|
400
|
+
#<strong>initialize</strong>(nombre_plato, conjunto_alimentos, cantidades_engramos, cantidades_totales_engramos) ⇒ <tt><span class='object_link'><a href="" title="Plato (class)">Plato</a></span></tt>
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
</h3><div class="docstring">
|
407
|
+
<div class="discussion">
|
408
|
+
|
409
|
+
<p>Método initialize</p>
|
410
|
+
|
411
|
+
|
412
|
+
</div>
|
413
|
+
</div>
|
414
|
+
<div class="tags">
|
415
|
+
<p class="tag_title">Parameters:</p>
|
416
|
+
<ul class="param">
|
417
|
+
|
418
|
+
<li>
|
419
|
+
|
420
|
+
<span class='name'>recibe</span>
|
421
|
+
|
422
|
+
|
423
|
+
<span class='type'></span>
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
—
|
428
|
+
<div class='inline'>
|
429
|
+
<p>los distintos parámetros para el plato</p>
|
430
|
+
</div>
|
431
|
+
|
432
|
+
</li>
|
433
|
+
|
434
|
+
</ul>
|
435
|
+
|
436
|
+
|
437
|
+
</div><table class="source_code">
|
438
|
+
<tr>
|
439
|
+
<td>
|
440
|
+
<pre class="lines">
|
441
|
+
|
442
|
+
|
443
|
+
8
|
444
|
+
9
|
445
|
+
10</pre>
|
446
|
+
</td>
|
447
|
+
<td>
|
448
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 8</span>
|
449
|
+
|
450
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_nombre_plato'>nombre_plato</span><span class='comma'>,</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='comma'>,</span> <span class='id identifier rubyid_cantidades_engramos'>cantidades_engramos</span><span class='comma'>,</span> <span class='id identifier rubyid_cantidades_totales_engramos'>cantidades_totales_engramos</span><span class='rparen'>)</span>
|
451
|
+
<span class='ivar'>@nombre_plato</span><span class='comma'>,</span> <span class='ivar'>@conjunto_alimentos</span><span class='comma'>,</span> <span class='ivar'>@cantidades_engramos</span><span class='comma'>,</span> <span class='ivar'>@cantidades_totales_engramos</span> <span class='op'>=</span> <span class='id identifier rubyid_nombre_plato'>nombre_plato</span><span class='comma'>,</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='comma'>,</span> <span class='id identifier rubyid_cantidades_engramos'>cantidades_engramos</span><span class='comma'>,</span> <span class='id identifier rubyid_cantidades_totales_engramos'>cantidades_totales_engramos</span>
|
452
|
+
<span class='kw'>end</span></pre>
|
453
|
+
</td>
|
454
|
+
</tr>
|
455
|
+
</table>
|
456
|
+
</div>
|
457
|
+
|
458
|
+
</div>
|
459
|
+
|
460
|
+
<div id="instance_attr_details" class="attr_details">
|
461
|
+
<h2>Instance Attribute Details</h2>
|
462
|
+
|
463
|
+
|
464
|
+
<span id="cantidades_engramos=-instance_method"></span>
|
465
|
+
<div class="method_details first">
|
466
|
+
<h3 class="signature first" id="cantidades_engramos-instance_method">
|
467
|
+
|
468
|
+
#<strong>cantidades_engramos</strong> ⇒ <tt>Object</tt>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
</h3><div class="docstring">
|
475
|
+
<div class="discussion">
|
476
|
+
|
477
|
+
<p>Returns the value of attribute cantidades_engramos</p>
|
478
|
+
|
479
|
+
|
480
|
+
</div>
|
481
|
+
</div>
|
482
|
+
<div class="tags">
|
483
|
+
|
484
|
+
|
485
|
+
</div><table class="source_code">
|
486
|
+
<tr>
|
487
|
+
<td>
|
488
|
+
<pre class="lines">
|
489
|
+
|
490
|
+
|
491
|
+
3
|
492
|
+
4
|
493
|
+
5</pre>
|
494
|
+
</td>
|
495
|
+
<td>
|
496
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 3</span>
|
497
|
+
|
498
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cantidades_engramos'>cantidades_engramos</span>
|
499
|
+
<span class='ivar'>@cantidades_engramos</span>
|
500
|
+
<span class='kw'>end</span></pre>
|
501
|
+
</td>
|
502
|
+
</tr>
|
503
|
+
</table>
|
504
|
+
</div>
|
505
|
+
|
506
|
+
|
507
|
+
<span id="cantidades_totales_engramos=-instance_method"></span>
|
508
|
+
<div class="method_details ">
|
509
|
+
<h3 class="signature " id="cantidades_totales_engramos-instance_method">
|
510
|
+
|
511
|
+
#<strong>cantidades_totales_engramos</strong> ⇒ <tt>Object</tt>
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
</h3><div class="docstring">
|
518
|
+
<div class="discussion">
|
519
|
+
|
520
|
+
<p>Returns the value of attribute cantidades_totales_engramos</p>
|
521
|
+
|
522
|
+
|
523
|
+
</div>
|
524
|
+
</div>
|
525
|
+
<div class="tags">
|
526
|
+
|
527
|
+
|
528
|
+
</div><table class="source_code">
|
529
|
+
<tr>
|
530
|
+
<td>
|
531
|
+
<pre class="lines">
|
532
|
+
|
533
|
+
|
534
|
+
3
|
535
|
+
4
|
536
|
+
5</pre>
|
537
|
+
</td>
|
538
|
+
<td>
|
539
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 3</span>
|
540
|
+
|
541
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cantidades_totales_engramos'>cantidades_totales_engramos</span>
|
542
|
+
<span class='ivar'>@cantidades_totales_engramos</span>
|
543
|
+
<span class='kw'>end</span></pre>
|
544
|
+
</td>
|
545
|
+
</tr>
|
546
|
+
</table>
|
547
|
+
</div>
|
548
|
+
|
549
|
+
|
550
|
+
<span id="conjunto_alimentos=-instance_method"></span>
|
551
|
+
<div class="method_details ">
|
552
|
+
<h3 class="signature " id="conjunto_alimentos-instance_method">
|
553
|
+
|
554
|
+
#<strong>conjunto_alimentos</strong> ⇒ <tt>Object</tt>
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
</h3><div class="docstring">
|
561
|
+
<div class="discussion">
|
562
|
+
|
563
|
+
<p>Returns the value of attribute conjunto_alimentos</p>
|
564
|
+
|
565
|
+
|
566
|
+
</div>
|
567
|
+
</div>
|
568
|
+
<div class="tags">
|
569
|
+
|
570
|
+
|
571
|
+
</div><table class="source_code">
|
572
|
+
<tr>
|
573
|
+
<td>
|
574
|
+
<pre class="lines">
|
575
|
+
|
576
|
+
|
577
|
+
3
|
578
|
+
4
|
579
|
+
5</pre>
|
580
|
+
</td>
|
581
|
+
<td>
|
582
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 3</span>
|
583
|
+
|
584
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span>
|
585
|
+
<span class='ivar'>@conjunto_alimentos</span>
|
586
|
+
<span class='kw'>end</span></pre>
|
587
|
+
</td>
|
588
|
+
</tr>
|
589
|
+
</table>
|
590
|
+
</div>
|
591
|
+
|
592
|
+
|
593
|
+
<span id="nombre_plato=-instance_method"></span>
|
594
|
+
<div class="method_details ">
|
595
|
+
<h3 class="signature " id="nombre_plato-instance_method">
|
596
|
+
|
597
|
+
#<strong>nombre_plato</strong> ⇒ <tt>Object</tt>
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
</h3><div class="docstring">
|
604
|
+
<div class="discussion">
|
605
|
+
|
606
|
+
<p>Returns the value of attribute nombre_plato</p>
|
607
|
+
|
608
|
+
|
609
|
+
</div>
|
610
|
+
</div>
|
611
|
+
<div class="tags">
|
612
|
+
|
613
|
+
|
614
|
+
</div><table class="source_code">
|
615
|
+
<tr>
|
616
|
+
<td>
|
617
|
+
<pre class="lines">
|
618
|
+
|
619
|
+
|
620
|
+
3
|
621
|
+
4
|
622
|
+
5</pre>
|
623
|
+
</td>
|
624
|
+
<td>
|
625
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 3</span>
|
626
|
+
|
627
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_nombre_plato'>nombre_plato</span>
|
628
|
+
<span class='ivar'>@nombre_plato</span>
|
629
|
+
<span class='kw'>end</span></pre>
|
630
|
+
</td>
|
631
|
+
</tr>
|
632
|
+
</table>
|
633
|
+
</div>
|
634
|
+
|
635
|
+
</div>
|
636
|
+
|
637
|
+
|
638
|
+
<div id="instance_method_details" class="method_details_list">
|
639
|
+
<h2>Instance Method Details</h2>
|
640
|
+
|
641
|
+
|
642
|
+
<div class="method_details first">
|
643
|
+
<h3 class="signature first" id="porcentaje_carbohidratos-instance_method">
|
644
|
+
|
645
|
+
#<strong>porcentaje_carbohidratos</strong> ⇒ <tt>Object</tt>
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
</h3><div class="docstring">
|
652
|
+
<div class="discussion">
|
653
|
+
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'>
|
654
|
+
<p>Sirve para hallar el porcentaje de carbohidratos de un plato</p>
|
655
|
+
</div></div>
|
656
|
+
|
657
|
+
<p>Metodo porcentaje de carbohidratos</p>
|
658
|
+
|
659
|
+
|
660
|
+
</div>
|
661
|
+
</div>
|
662
|
+
<div class="tags">
|
663
|
+
|
664
|
+
<p class="tag_title">Returns:</p>
|
665
|
+
<ul class="return">
|
666
|
+
|
667
|
+
<li>
|
668
|
+
|
669
|
+
|
670
|
+
<span class='type'></span>
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
<div class='inline'>
|
676
|
+
<p>Retorna un string con el total de porcentaje de carbohidratos</p>
|
677
|
+
</div>
|
678
|
+
|
679
|
+
</li>
|
680
|
+
|
681
|
+
</ul>
|
682
|
+
|
683
|
+
</div><table class="source_code">
|
684
|
+
<tr>
|
685
|
+
<td>
|
686
|
+
<pre class="lines">
|
687
|
+
|
688
|
+
|
689
|
+
54
|
690
|
+
55
|
691
|
+
56
|
692
|
+
57
|
693
|
+
58
|
694
|
+
59
|
695
|
+
60
|
696
|
+
61
|
697
|
+
62
|
698
|
+
63
|
699
|
+
64
|
700
|
+
65
|
701
|
+
66
|
702
|
+
67
|
703
|
+
68</pre>
|
704
|
+
</td>
|
705
|
+
<td>
|
706
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 54</span>
|
707
|
+
|
708
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_porcentaje_carbohidratos'>porcentaje_carbohidratos</span>
|
709
|
+
|
710
|
+
<span class='id identifier rubyid_total_carbohidratos'>total_carbohidratos</span> <span class='op'>=</span> <span class='int'>0</span>
|
711
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='int'>0</span>
|
712
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_i'>i</span> <span class='op'><</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='kw'>do</span>
|
713
|
+
<span class='id identifier rubyid_aux'>aux</span> <span class='op'>=</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_carbohidratos'>carbohidratos</span> <span class='op'>*</span> <span class='id identifier rubyid_cantidades_engramos'>cantidades_engramos</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span>
|
714
|
+
<span class='id identifier rubyid_total_carbohidratos'>total_carbohidratos</span> <span class='op'>+=</span> <span class='id identifier rubyid_aux'>aux</span>
|
715
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>+=</span> <span class='int'>1</span>
|
716
|
+
<span class='kw'>end</span>
|
717
|
+
|
718
|
+
<span class='id identifier rubyid_tporcentaje_carbohidratos'>tporcentaje_carbohidratos</span> <span class='op'>=</span> <span class='int'>0</span>
|
719
|
+
<span class='id identifier rubyid_tporcentaje_carbohidratos'>tporcentaje_carbohidratos</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_total_carbohidratos'>total_carbohidratos</span><span class='op'>/</span><span class='id identifier rubyid_cantidades_totales_engramos'>cantidades_totales_engramos</span><span class='rparen'>)</span><span class='op'>*</span><span class='int'>100</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
720
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tporcentaje_carbohidratos'>tporcentaje_carbohidratos</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span>
|
721
|
+
|
722
|
+
<span class='kw'>end</span></pre>
|
723
|
+
</td>
|
724
|
+
</tr>
|
725
|
+
</table>
|
726
|
+
</div>
|
727
|
+
|
728
|
+
<div class="method_details ">
|
729
|
+
<h3 class="signature " id="porcentaje_lipidos-instance_method">
|
730
|
+
|
731
|
+
#<strong>porcentaje_lipidos</strong> ⇒ <tt>Object</tt>
|
732
|
+
|
733
|
+
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
</h3><div class="docstring">
|
738
|
+
<div class="discussion">
|
739
|
+
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'>
|
740
|
+
<p>Sirve para hallar el porcentaje de lipidos de un plato</p>
|
741
|
+
</div></div>
|
742
|
+
|
743
|
+
<p>Metodos de porcentaje de lipidos</p>
|
744
|
+
|
745
|
+
|
746
|
+
</div>
|
747
|
+
</div>
|
748
|
+
<div class="tags">
|
749
|
+
|
750
|
+
<p class="tag_title">Returns:</p>
|
751
|
+
<ul class="return">
|
752
|
+
|
753
|
+
<li>
|
754
|
+
|
755
|
+
|
756
|
+
<span class='type'></span>
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
|
761
|
+
<div class='inline'>
|
762
|
+
<p>Devuelve un string con el porcentaje total de lipidos que posee el plato</p>
|
763
|
+
</div>
|
764
|
+
|
765
|
+
</li>
|
766
|
+
|
767
|
+
</ul>
|
768
|
+
|
769
|
+
</div><table class="source_code">
|
770
|
+
<tr>
|
771
|
+
<td>
|
772
|
+
<pre class="lines">
|
773
|
+
|
774
|
+
|
775
|
+
35
|
776
|
+
36
|
777
|
+
37
|
778
|
+
38
|
779
|
+
39
|
780
|
+
40
|
781
|
+
41
|
782
|
+
42
|
783
|
+
43
|
784
|
+
44
|
785
|
+
45
|
786
|
+
46
|
787
|
+
47
|
788
|
+
48
|
789
|
+
49</pre>
|
790
|
+
</td>
|
791
|
+
<td>
|
792
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 35</span>
|
793
|
+
|
794
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_porcentaje_lipidos'>porcentaje_lipidos</span>
|
795
|
+
|
796
|
+
<span class='id identifier rubyid_total_lipidos'>total_lipidos</span> <span class='op'>=</span> <span class='int'>0</span>
|
797
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='int'>0</span>
|
798
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_i'>i</span> <span class='op'><</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='kw'>do</span>
|
799
|
+
<span class='id identifier rubyid_aux'>aux</span> <span class='op'>=</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_lipidos'>lipidos</span> <span class='op'>*</span> <span class='id identifier rubyid_cantidades_engramos'>cantidades_engramos</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span>
|
800
|
+
<span class='id identifier rubyid_total_lipidos'>total_lipidos</span> <span class='op'>+=</span> <span class='id identifier rubyid_aux'>aux</span>
|
801
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>+=</span> <span class='int'>1</span>
|
802
|
+
<span class='kw'>end</span>
|
803
|
+
|
804
|
+
<span class='id identifier rubyid_tporcentaje_lipidos'>tporcentaje_lipidos</span> <span class='op'>=</span> <span class='int'>0</span>
|
805
|
+
<span class='id identifier rubyid_tporcentaje_lipidos'>tporcentaje_lipidos</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_total_lipidos'>total_lipidos</span><span class='op'>/</span><span class='id identifier rubyid_cantidades_totales_engramos'>cantidades_totales_engramos</span><span class='rparen'>)</span><span class='op'>*</span><span class='int'>100</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
806
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tporcentaje_lipidos'>tporcentaje_lipidos</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span>
|
807
|
+
|
808
|
+
<span class='kw'>end</span></pre>
|
809
|
+
</td>
|
810
|
+
</tr>
|
811
|
+
</table>
|
812
|
+
</div>
|
813
|
+
|
814
|
+
<div class="method_details ">
|
815
|
+
<h3 class="signature " id="porcentaje_proteinas-instance_method">
|
816
|
+
|
817
|
+
#<strong>porcentaje_proteinas</strong> ⇒ <tt>Object</tt>
|
818
|
+
|
819
|
+
|
820
|
+
|
821
|
+
|
822
|
+
|
823
|
+
</h3><div class="docstring">
|
824
|
+
<div class="discussion">
|
825
|
+
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'>
|
826
|
+
<p>Sirve para hallar el porcentaje total de proteinas del plato a tratar</p>
|
827
|
+
</div></div>
|
828
|
+
|
829
|
+
<p>Metodo de porcentaje_proteinas</p>
|
830
|
+
|
831
|
+
|
832
|
+
</div>
|
833
|
+
</div>
|
834
|
+
<div class="tags">
|
835
|
+
|
836
|
+
<p class="tag_title">Returns:</p>
|
837
|
+
<ul class="return">
|
838
|
+
|
839
|
+
<li>
|
840
|
+
|
841
|
+
|
842
|
+
<span class='type'></span>
|
843
|
+
|
844
|
+
|
845
|
+
|
846
|
+
|
847
|
+
<div class='inline'>
|
848
|
+
<p>retorna el valor un string con el porcentaje de proteinas</p>
|
849
|
+
</div>
|
850
|
+
|
851
|
+
</li>
|
852
|
+
|
853
|
+
</ul>
|
854
|
+
|
855
|
+
</div><table class="source_code">
|
856
|
+
<tr>
|
857
|
+
<td>
|
858
|
+
<pre class="lines">
|
859
|
+
|
860
|
+
|
861
|
+
16
|
862
|
+
17
|
863
|
+
18
|
864
|
+
19
|
865
|
+
20
|
866
|
+
21
|
867
|
+
22
|
868
|
+
23
|
869
|
+
24
|
870
|
+
25
|
871
|
+
26
|
872
|
+
27
|
873
|
+
28
|
874
|
+
29</pre>
|
875
|
+
</td>
|
876
|
+
<td>
|
877
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 16</span>
|
878
|
+
|
879
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_porcentaje_proteinas'>porcentaje_proteinas</span>
|
880
|
+
|
881
|
+
<span class='id identifier rubyid_total_proteinas'>total_proteinas</span> <span class='op'>=</span> <span class='int'>0</span>
|
882
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='int'>0</span>
|
883
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_i'>i</span> <span class='op'><</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='kw'>do</span>
|
884
|
+
<span class='id identifier rubyid_aux'>aux</span> <span class='op'>=</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_proteinas'>proteinas</span> <span class='op'>*</span> <span class='id identifier rubyid_cantidades_engramos'>cantidades_engramos</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span>
|
885
|
+
<span class='id identifier rubyid_total_proteinas'>total_proteinas</span> <span class='op'>+=</span> <span class='id identifier rubyid_aux'>aux</span>
|
886
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>+=</span> <span class='int'>1</span>
|
887
|
+
<span class='kw'>end</span>
|
888
|
+
|
889
|
+
<span class='id identifier rubyid_tporcentaje_proteinas'>tporcentaje_proteinas</span> <span class='op'>=</span> <span class='int'>0</span>
|
890
|
+
<span class='id identifier rubyid_tporcentaje_proteinas'>tporcentaje_proteinas</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_total_proteinas'>total_proteinas</span><span class='op'>/</span><span class='id identifier rubyid_cantidades_totales_engramos'>cantidades_totales_engramos</span><span class='rparen'>)</span><span class='op'>*</span><span class='int'>100</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
891
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tporcentaje_proteinas'>tporcentaje_proteinas</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span>
|
892
|
+
<span class='kw'>end</span></pre>
|
893
|
+
</td>
|
894
|
+
</tr>
|
895
|
+
</table>
|
896
|
+
</div>
|
897
|
+
|
898
|
+
<div class="method_details ">
|
899
|
+
<h3 class="signature " id="to_s-instance_method">
|
900
|
+
|
901
|
+
#<strong>to_s</strong> ⇒ <tt>Object</tt>
|
902
|
+
|
903
|
+
|
904
|
+
|
905
|
+
|
906
|
+
|
907
|
+
</h3><div class="docstring">
|
908
|
+
<div class="discussion">
|
909
|
+
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'>
|
910
|
+
<p>Sirve para dar el plato en su forma formateada</p>
|
911
|
+
</div></div>
|
912
|
+
|
913
|
+
<p>Metodo to_s</p>
|
914
|
+
|
915
|
+
|
916
|
+
</div>
|
917
|
+
</div>
|
918
|
+
<div class="tags">
|
919
|
+
|
920
|
+
|
921
|
+
</div><table class="source_code">
|
922
|
+
<tr>
|
923
|
+
<td>
|
924
|
+
<pre class="lines">
|
925
|
+
|
926
|
+
|
927
|
+
89
|
928
|
+
90
|
929
|
+
91
|
930
|
+
92</pre>
|
931
|
+
</td>
|
932
|
+
<td>
|
933
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 89</span>
|
934
|
+
|
935
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
936
|
+
|
937
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Plato: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@nombre_plato</span><span class='embexpr_end'>}</span><span class='tstring_content'>, \nIngredientes: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@conjunto_alimentos</span><span class='embexpr_end'>}</span><span class='tstring_content'>,\nCantidad total del plato: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@cantidades_totales_engramos</span><span class='embexpr_end'>}</span><span class='tstring_content'>, separados en las siguientes cantidades por alimento </span><span class='embexpr_beg'>#{</span><span class='ivar'>@cantidades_engramos</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
938
|
+
<span class='kw'>end</span></pre>
|
939
|
+
</td>
|
940
|
+
</tr>
|
941
|
+
</table>
|
942
|
+
</div>
|
943
|
+
|
944
|
+
<div class="method_details ">
|
945
|
+
<h3 class="signature " id="valor_calorico_total-instance_method">
|
946
|
+
|
947
|
+
#<strong>valor_calorico_total</strong> ⇒ <tt>Object</tt>
|
948
|
+
|
949
|
+
|
950
|
+
|
951
|
+
|
952
|
+
|
953
|
+
</h3><div class="docstring">
|
954
|
+
<div class="discussion">
|
955
|
+
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'>
|
956
|
+
<p>Sirve para hallar el valor calorico total del plato</p>
|
957
|
+
</div></div>
|
958
|
+
|
959
|
+
<p>Metodo valor calorico</p>
|
960
|
+
|
961
|
+
|
962
|
+
</div>
|
963
|
+
</div>
|
964
|
+
<div class="tags">
|
965
|
+
|
966
|
+
<p class="tag_title">Returns:</p>
|
967
|
+
<ul class="return">
|
968
|
+
|
969
|
+
<li>
|
970
|
+
|
971
|
+
|
972
|
+
<span class='type'></span>
|
973
|
+
|
974
|
+
|
975
|
+
|
976
|
+
|
977
|
+
<div class='inline'>
|
978
|
+
<p>Devuelve un entero con el valor calorico total del plato</p>
|
979
|
+
</div>
|
980
|
+
|
981
|
+
</li>
|
982
|
+
|
983
|
+
</ul>
|
984
|
+
|
985
|
+
</div><table class="source_code">
|
986
|
+
<tr>
|
987
|
+
<td>
|
988
|
+
<pre class="lines">
|
989
|
+
|
990
|
+
|
991
|
+
74
|
992
|
+
75
|
993
|
+
76
|
994
|
+
77
|
995
|
+
78
|
996
|
+
79
|
997
|
+
80
|
998
|
+
81
|
999
|
+
82
|
1000
|
+
83
|
1001
|
+
84</pre>
|
1002
|
+
</td>
|
1003
|
+
<td>
|
1004
|
+
<pre class="code"><span class="info file"># File 'lib/pract06/plato.rb', line 74</span>
|
1005
|
+
|
1006
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_valor_calorico_total'>valor_calorico_total</span>
|
1007
|
+
|
1008
|
+
<span class='id identifier rubyid_total_vc'>total_vc</span> <span class='op'>=</span> <span class='int'>0</span>
|
1009
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='int'>0</span>
|
1010
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_i'>i</span> <span class='op'><</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='kw'>do</span>
|
1011
|
+
<span class='id identifier rubyid_total_vc'>total_vc</span> <span class='op'>+=</span> <span class='id identifier rubyid_conjunto_alimentos'>conjunto_alimentos</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_valor_energetico'>valor_energetico</span> <span class='op'>+</span> <span class='id identifier rubyid_total_vc'>total_vc</span>
|
1012
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1013
|
+
<span class='kw'>end</span>
|
1014
|
+
|
1015
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_total_vc'>total_vc</span>
|
1016
|
+
<span class='kw'>end</span></pre>
|
1017
|
+
</td>
|
1018
|
+
</tr>
|
1019
|
+
</table>
|
1020
|
+
</div>
|
1021
|
+
|
1022
|
+
</div>
|
1023
|
+
|
1024
|
+
</div>
|
1025
|
+
|
1026
|
+
<div id="footer">
|
1027
|
+
Generated on Wed Dec 18 17:08:16 2019 by
|
1028
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1029
|
+
0.9.20 (ruby-2.6.3).
|
1030
|
+
</div>
|
1031
|
+
|
1032
|
+
</div>
|
1033
|
+
</body>
|
1034
|
+
</html>
|