practica6germanAT 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 +2 -0
- data/.gitignore +10 -0
- data/.rspec +3 -0
- data/.travis.yml +9 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +95 -0
- data/Guardfile +85 -0
- data/README.md +19 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/Comida.html +1030 -0
- data/doc/List.html +1346 -0
- data/doc/List/Node.html +409 -0
- data/doc/MejorPlato.html +1007 -0
- data/doc/Menu.html +400 -0
- data/doc/Plato.html +1125 -0
- data/doc/Practica6.html +144 -0
- data/doc/Practica6/Error.html +124 -0
- data/doc/_index.html +186 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +97 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +97 -0
- data/doc/js/app.js +303 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +443 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/practica6.rb +14 -0
- data/lib/practica6/comida.rb +59 -0
- data/lib/practica6/lista.rb +173 -0
- data/lib/practica6/mejorplatos.rb +122 -0
- data/lib/practica6/menu.rb +48 -0
- data/lib/practica6/platos.rb +136 -0
- data/lib/practica6/version.rb +7 -0
- data/practica6.gemspec +36 -0
- metadata +167 -0
data/doc/List/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: List::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 = "List::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
|
+
<span class='title'><span class='object_link'><a href="../List.html" title="List (class)">List</a></span></span>
|
|
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: List::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">List::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/practica6/lista.rb</dd>
|
|
100
|
+
</dl>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
|
105
|
+
<div class="discussion">
|
|
106
|
+
|
|
107
|
+
<p>Nodo que forma la Lista</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
|
+
12
|
|
260
|
+
13
|
|
261
|
+
14</pre>
|
|
262
|
+
</td>
|
|
263
|
+
<td>
|
|
264
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/lista.rb', line 12</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
|
+
12
|
|
321
|
+
13
|
|
322
|
+
14</pre>
|
|
323
|
+
</td>
|
|
324
|
+
<td>
|
|
325
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/lista.rb', line 12</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
|
+
12
|
|
382
|
+
13
|
|
383
|
+
14</pre>
|
|
384
|
+
</td>
|
|
385
|
+
<td>
|
|
386
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/lista.rb', line 12</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 Tue Dec 17 19:32:04 2019 by
|
|
403
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
404
|
+
0.9.20 (ruby-2.5.1).
|
|
405
|
+
</div>
|
|
406
|
+
|
|
407
|
+
</div>
|
|
408
|
+
</body>
|
|
409
|
+
</html>
|
data/doc/MejorPlato.html
ADDED
|
@@ -0,0 +1,1007 @@
|
|
|
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: MejorPlato
|
|
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 = "MejorPlato";
|
|
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 (M)</a> »
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<span class="title">MejorPlato</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: MejorPlato
|
|
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="Plato.html" title="Plato (class)">Plato</a></span></span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next"><span class='object_link'><a href="Plato.html" title="Plato (class)">Plato</a></span></li>
|
|
78
|
+
|
|
79
|
+
<li class="next">MejorPlato</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/practica6/mejorplatos.rb</dd>
|
|
100
|
+
</dl>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<h2>Instance Attribute Summary</h2>
|
|
111
|
+
|
|
112
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Plato.html" title="Plato (class)">Plato</a></span></h3>
|
|
113
|
+
<p class="inherited"><span class='object_link'><a href="Plato.html#conjuntoAlimentos-instance_method" title="Plato#conjuntoAlimentos (method)">#conjuntoAlimentos</a></span>, <span class='object_link'><a href="Plato.html#conjuntoCantidades-instance_method" title="Plato#conjuntoCantidades (method)">#conjuntoCantidades</a></span>, <span class='object_link'><a href="Plato.html#nombrePlato-instance_method" title="Plato#nombrePlato (method)">#nombrePlato</a></span></p>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<h2>
|
|
118
|
+
Instance Method Summary
|
|
119
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
120
|
+
</h2>
|
|
121
|
+
|
|
122
|
+
<ul class="summary">
|
|
123
|
+
|
|
124
|
+
<li class="public ">
|
|
125
|
+
<span class="summary_signature">
|
|
126
|
+
|
|
127
|
+
<a href="#<=>-instance_method" title="#<=> (instance method)">#<strong><=></strong>(another) ⇒ Object </a>
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
</span>
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
<span class="summary_desc"><div class='inline'>
|
|
142
|
+
<p>Sobreescritura de la funcion <=> de la clase Comparable para comparar
|
|
143
|
+
dos elementos.</p>
|
|
144
|
+
</div></span>
|
|
145
|
+
|
|
146
|
+
</li>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
<li class="public ">
|
|
150
|
+
<span class="summary_signature">
|
|
151
|
+
|
|
152
|
+
<a href="#aumentarPrecios-instance_method" title="#aumentarPrecios (instance method)">#<strong>aumentarPrecios</strong>(arrayPrecios, menu) ⇒ Array[Float] </a>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
</span>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<span class="summary_desc"><div class='inline'>
|
|
167
|
+
<p>Dado un array de platos y un array de precios, incrementa el array de los
|
|
168
|
+
precios en base al plato con mayor Huella Nutricional del array de platos.</p>
|
|
169
|
+
</div></span>
|
|
170
|
+
|
|
171
|
+
</li>
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
<li class="public ">
|
|
175
|
+
<span class="summary_signature">
|
|
176
|
+
|
|
177
|
+
<a href="#costeTerreno-instance_method" title="#costeTerreno (instance method)">#<strong>costeTerreno</strong> ⇒ Double </a>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
</span>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<span class="summary_desc"><div class='inline'>
|
|
192
|
+
<p>Cantidad de m2 que han necesitado ser utilizados para producir el plato.</p>
|
|
193
|
+
</div></span>
|
|
194
|
+
|
|
195
|
+
</li>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
<li class="public ">
|
|
199
|
+
<span class="summary_signature">
|
|
200
|
+
|
|
201
|
+
<a href="#eficienciaEnergetica-instance_method" title="#eficienciaEnergetica (instance method)">#<strong>eficienciaEnergetica</strong> ⇒ Double </a>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</span>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
<span class="summary_desc"><div class='inline'>
|
|
216
|
+
<p>Eficiencia energética del plato (kilocalorias).</p>
|
|
217
|
+
</div></span>
|
|
218
|
+
|
|
219
|
+
</li>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
<li class="public ">
|
|
223
|
+
<span class="summary_signature">
|
|
224
|
+
|
|
225
|
+
<a href="#emisionInvernadero-instance_method" title="#emisionInvernadero (instance method)">#<strong>emisionInvernadero</strong> ⇒ Double </a>
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
</span>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
<span class="summary_desc"><div class='inline'>
|
|
240
|
+
<p>Cantidad de gases de efecto invernadero liberados por el plato en cuestión.</p>
|
|
241
|
+
</div></span>
|
|
242
|
+
|
|
243
|
+
</li>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
<li class="public ">
|
|
247
|
+
<span class="summary_signature">
|
|
248
|
+
|
|
249
|
+
<a href="#huellaNutricional-instance_method" title="#huellaNutricional (instance method)">#<strong>huellaNutricional</strong> ⇒ Integer </a>
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
</span>
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
<span class="summary_desc"><div class='inline'>
|
|
264
|
+
<p>Devuelve un entero en un rango [1 - 3] que indica el impacto medioambiental
|
|
265
|
+
del plato según su valor calórico total y sus emisiones de efecto
|
|
266
|
+
invernadero.</p>
|
|
267
|
+
</div></span>
|
|
268
|
+
|
|
269
|
+
</li>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
<li class="public ">
|
|
273
|
+
<span class="summary_signature">
|
|
274
|
+
|
|
275
|
+
<a href="#indicadorCarbono-instance_method" title="#indicadorCarbono (instance method)">#<strong>indicadorCarbono</strong> ⇒ Object </a>
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
</span>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
<span class="summary_desc"><div class='inline'>
|
|
290
|
+
<p>Vease #huellaNutricional.</p>
|
|
291
|
+
</div></span>
|
|
292
|
+
|
|
293
|
+
</li>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
<li class="public ">
|
|
297
|
+
<span class="summary_signature">
|
|
298
|
+
|
|
299
|
+
<a href="#indicadorEnergia-instance_method" title="#indicadorEnergia (instance method)">#<strong>indicadorEnergia</strong> ⇒ Object </a>
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
</span>
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
<span class="summary_desc"><div class='inline'>
|
|
314
|
+
<p>Vease #huellaNutricional.</p>
|
|
315
|
+
</div></span>
|
|
316
|
+
|
|
317
|
+
</li>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
<li class="public ">
|
|
321
|
+
<span class="summary_signature">
|
|
322
|
+
|
|
323
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(nombrePlato, conjuntoAlimentos, conjuntoCantidades) ⇒ MejorPlato </a>
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
</span>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
<span class="note title constructor">constructor</span>
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
<span class="summary_desc"><div class='inline'>
|
|
340
|
+
<p>A new instance of MejorPlato.</p>
|
|
341
|
+
</div></span>
|
|
342
|
+
|
|
343
|
+
</li>
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
</ul>
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Plato.html" title="Plato (class)">Plato</a></span></h3>
|
|
359
|
+
<p class="inherited"><span class='object_link'><a href="Plato.html#conjuntoPorcentaje-instance_method" title="Plato#conjuntoPorcentaje (method)">#conjuntoPorcentaje</a></span>, <span class='object_link'><a href="Plato.html#porCarbohidratos-instance_method" title="Plato#porCarbohidratos (method)">#porCarbohidratos</a></span>, <span class='object_link'><a href="Plato.html#porLipidos-instance_method" title="Plato#porLipidos (method)">#porLipidos</a></span>, <span class='object_link'><a href="Plato.html#porProteinas-instance_method" title="Plato#porProteinas (method)">#porProteinas</a></span>, <span class='object_link'><a href="Plato.html#to_s-instance_method" title="Plato#to_s (method)">#to_s</a></span>, <span class='object_link'><a href="Plato.html#valorCaloricoTotal-instance_method" title="Plato#valorCaloricoTotal (method)">#valorCaloricoTotal</a></span></p>
|
|
360
|
+
|
|
361
|
+
<div id="constructor_details" class="method_details_list">
|
|
362
|
+
<h2>Constructor Details</h2>
|
|
363
|
+
|
|
364
|
+
<div class="method_details first">
|
|
365
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
366
|
+
|
|
367
|
+
#<strong>initialize</strong>(nombrePlato, conjuntoAlimentos, conjuntoCantidades) ⇒ <tt><span class='object_link'><a href="" title="MejorPlato (class)">MejorPlato</a></span></tt>
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
</h3><div class="docstring">
|
|
374
|
+
<div class="discussion">
|
|
375
|
+
|
|
376
|
+
<p>Returns a new instance of MejorPlato</p>
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
</div>
|
|
380
|
+
</div>
|
|
381
|
+
<div class="tags">
|
|
382
|
+
<p class="tag_title">Parameters:</p>
|
|
383
|
+
<ul class="param">
|
|
384
|
+
|
|
385
|
+
<li>
|
|
386
|
+
|
|
387
|
+
<span class='name'>conjuntoAlimentos</span>
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
<span class='type'>(<tt><span class='object_link'><a href="List.html" title="List (class)">List</a></span></tt>)</span>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
—
|
|
395
|
+
<div class='inline'>
|
|
396
|
+
<p>Lista de alimentos que forman el plato.</p>
|
|
397
|
+
</div>
|
|
398
|
+
|
|
399
|
+
</li>
|
|
400
|
+
|
|
401
|
+
<li>
|
|
402
|
+
|
|
403
|
+
<span class='name'>conjuntoCantidades</span>
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
<span class='type'>(<tt><span class='object_link'><a href="List.html" title="List (class)">List</a></span></tt>)</span>
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
—
|
|
411
|
+
<div class='inline'>
|
|
412
|
+
<p>Lista de cantidades de cada alimento que forma el plato.</p>
|
|
413
|
+
</div>
|
|
414
|
+
|
|
415
|
+
</li>
|
|
416
|
+
|
|
417
|
+
</ul>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
</div><table class="source_code">
|
|
421
|
+
<tr>
|
|
422
|
+
<td>
|
|
423
|
+
<pre class="lines">
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
11
|
|
427
|
+
12
|
|
428
|
+
13</pre>
|
|
429
|
+
</td>
|
|
430
|
+
<td>
|
|
431
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 11</span>
|
|
432
|
+
|
|
433
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_nombrePlato'>nombrePlato</span><span class='comma'>,</span> <span class='id identifier rubyid_conjuntoAlimentos'>conjuntoAlimentos</span><span class='comma'>,</span> <span class='id identifier rubyid_conjuntoCantidades'>conjuntoCantidades</span><span class='rparen'>)</span>
|
|
434
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_nombrePlato'>nombrePlato</span><span class='comma'>,</span> <span class='id identifier rubyid_conjuntoAlimentos'>conjuntoAlimentos</span><span class='comma'>,</span> <span class='id identifier rubyid_conjuntoCantidades'>conjuntoCantidades</span><span class='rparen'>)</span>
|
|
435
|
+
<span class='kw'>end</span></pre>
|
|
436
|
+
</td>
|
|
437
|
+
</tr>
|
|
438
|
+
</table>
|
|
439
|
+
</div>
|
|
440
|
+
|
|
441
|
+
</div>
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
<div id="instance_method_details" class="method_details_list">
|
|
445
|
+
<h2>Instance Method Details</h2>
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
<div class="method_details first">
|
|
449
|
+
<h3 class="signature first" id="<=>-instance_method">
|
|
450
|
+
|
|
451
|
+
#<strong><=></strong>(another) ⇒ <tt>Object</tt>
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
</h3><div class="docstring">
|
|
458
|
+
<div class="discussion">
|
|
459
|
+
|
|
460
|
+
<p>Sobreescritura de la funcion <=> de la clase Comparable para comparar
|
|
461
|
+
dos elementos</p>
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
</div>
|
|
465
|
+
</div>
|
|
466
|
+
<div class="tags">
|
|
467
|
+
<p class="tag_title">Parameters:</p>
|
|
468
|
+
<ul class="param">
|
|
469
|
+
|
|
470
|
+
<li>
|
|
471
|
+
|
|
472
|
+
<span class='name'>another</span>
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
<span class='type'>(<tt><span class='object_link'><a href="Comida.html" title="Comida (class)">Comida</a></span></tt>)</span>
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
—
|
|
480
|
+
<div class='inline'>
|
|
481
|
+
<p>Plato/MejorPlato con el que se pretende comparar este Plato (el plato con
|
|
482
|
+
mayor #huellaNutricional será mayor).</p>
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
</li>
|
|
486
|
+
|
|
487
|
+
</ul>
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
</div><table class="source_code">
|
|
491
|
+
<tr>
|
|
492
|
+
<td>
|
|
493
|
+
<pre class="lines">
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
96
|
|
497
|
+
97
|
|
498
|
+
98
|
|
499
|
+
99
|
|
500
|
+
100</pre>
|
|
501
|
+
</td>
|
|
502
|
+
<td>
|
|
503
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 96</span>
|
|
504
|
+
|
|
505
|
+
<span class='kw'>def</span> <span class='op'><=></span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='rparen'>)</span>
|
|
506
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='op'>==</span> <span class='const'><span class='object_link'><a href="" title="MejorPlato (class)">MejorPlato</a></span></span>
|
|
507
|
+
<span class='id identifier rubyid_huellaNutricional'>huellaNutricional</span><span class='op'><=></span> <span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_huellaNutricional'>huellaNutricional</span>
|
|
508
|
+
<span class='kw'>end</span>
|
|
509
|
+
<span class='kw'>end</span></pre>
|
|
510
|
+
</td>
|
|
511
|
+
</tr>
|
|
512
|
+
</table>
|
|
513
|
+
</div>
|
|
514
|
+
|
|
515
|
+
<div class="method_details ">
|
|
516
|
+
<h3 class="signature " id="aumentarPrecios-instance_method">
|
|
517
|
+
|
|
518
|
+
#<strong>aumentarPrecios</strong>(arrayPrecios, menu) ⇒ <tt>Array[Float]</tt>
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
</h3><div class="docstring">
|
|
525
|
+
<div class="discussion">
|
|
526
|
+
|
|
527
|
+
<p>Dado un array de platos y un array de precios, incrementa el array de los
|
|
528
|
+
precios en base al plato con mayor Huella Nutricional del array de platos.</p>
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
<div class="tags">
|
|
534
|
+
<p class="tag_title">Parameters:</p>
|
|
535
|
+
<ul class="param">
|
|
536
|
+
|
|
537
|
+
<li>
|
|
538
|
+
|
|
539
|
+
<span class='name'>arrayPrecios</span>
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
<span class='type'>(<tt>Array[Float]</tt>)</span>
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
—
|
|
547
|
+
<div class='inline'>
|
|
548
|
+
<p>Array de precios.</p>
|
|
549
|
+
</div>
|
|
550
|
+
|
|
551
|
+
</li>
|
|
552
|
+
|
|
553
|
+
<li>
|
|
554
|
+
|
|
555
|
+
<span class='name'>arrayPrecios</span>
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
<span class='type'>(<tt>Array[<span class='object_link'><a href="" title="MejorPlato (class)">MejorPlato</a></span>]</tt>)</span>
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
—
|
|
563
|
+
<div class='inline'>
|
|
564
|
+
<p>Array de platos.</p>
|
|
565
|
+
</div>
|
|
566
|
+
|
|
567
|
+
</li>
|
|
568
|
+
|
|
569
|
+
</ul>
|
|
570
|
+
|
|
571
|
+
<p class="tag_title">Returns:</p>
|
|
572
|
+
<ul class="return">
|
|
573
|
+
|
|
574
|
+
<li>
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
<span class='type'>(<tt>Array[Float]</tt>)</span>
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
—
|
|
582
|
+
<div class='inline'>
|
|
583
|
+
<p>array de precios arrayPrecio incrementado.</p>
|
|
584
|
+
</div>
|
|
585
|
+
|
|
586
|
+
</li>
|
|
587
|
+
|
|
588
|
+
</ul>
|
|
589
|
+
|
|
590
|
+
</div><table class="source_code">
|
|
591
|
+
<tr>
|
|
592
|
+
<td>
|
|
593
|
+
<pre class="lines">
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
110
|
|
597
|
+
111
|
|
598
|
+
112
|
|
599
|
+
113
|
|
600
|
+
114
|
|
601
|
+
115
|
|
602
|
+
116
|
|
603
|
+
117
|
|
604
|
+
118
|
|
605
|
+
119
|
|
606
|
+
120</pre>
|
|
607
|
+
</td>
|
|
608
|
+
<td>
|
|
609
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 110</span>
|
|
610
|
+
|
|
611
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_aumentarPrecios'>aumentarPrecios</span><span class='lparen'>(</span><span class='id identifier rubyid_arrayPrecios'>arrayPrecios</span><span class='comma'>,</span> <span class='id identifier rubyid_menu'>menu</span><span class='rparen'>)</span>
|
|
612
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_menu'>menu</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='period'>.</span><span class='id identifier rubyid_huellaNutricional'>huellaNutricional</span><span class='op'>==</span> <span class='int'>1</span><span class='rparen'>)</span>
|
|
613
|
+
<span class='id identifier rubyid_arrayPrecios'>arrayPrecios</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span> <span class='id identifier rubyid_a'>a</span> <span class='op'>*</span> <span class='int'>2</span><span class='rbrace'>}</span>
|
|
614
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='id identifier rubyid_menu'>menu</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='period'>.</span><span class='id identifier rubyid_huellaNutricional'>huellaNutricional</span><span class='op'>==</span> <span class='int'>2</span><span class='rparen'>)</span>
|
|
615
|
+
<span class='id identifier rubyid_arrayPrecios'>arrayPrecios</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span> <span class='id identifier rubyid_a'>a</span> <span class='op'>*</span> <span class='int'>3</span><span class='rbrace'>}</span>
|
|
616
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='id identifier rubyid_menu'>menu</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='period'>.</span><span class='id identifier rubyid_huellaNutricional'>huellaNutricional</span><span class='op'>==</span> <span class='int'>3</span><span class='rparen'>)</span>
|
|
617
|
+
<span class='id identifier rubyid_arrayPrecios'>arrayPrecios</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span> <span class='id identifier rubyid_a'>a</span> <span class='op'>*</span> <span class='int'>4</span><span class='rbrace'>}</span>
|
|
618
|
+
<span class='kw'>else</span>
|
|
619
|
+
<span class='kw'>return</span> <span class='op'>-</span><span class='int'>1</span>
|
|
620
|
+
<span class='kw'>end</span>
|
|
621
|
+
<span class='kw'>end</span></pre>
|
|
622
|
+
</td>
|
|
623
|
+
</tr>
|
|
624
|
+
</table>
|
|
625
|
+
</div>
|
|
626
|
+
|
|
627
|
+
<div class="method_details ">
|
|
628
|
+
<h3 class="signature " id="costeTerreno-instance_method">
|
|
629
|
+
|
|
630
|
+
#<strong>costeTerreno</strong> ⇒ <tt>Double</tt>
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
</h3><div class="docstring">
|
|
637
|
+
<div class="discussion">
|
|
638
|
+
|
|
639
|
+
<p>Cantidad de m2 que han necesitado ser utilizados para producir el plato.</p>
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
</div>
|
|
643
|
+
</div>
|
|
644
|
+
<div class="tags">
|
|
645
|
+
|
|
646
|
+
<p class="tag_title">Returns:</p>
|
|
647
|
+
<ul class="return">
|
|
648
|
+
|
|
649
|
+
<li>
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
<span class='type'>(<tt>Double</tt>)</span>
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
—
|
|
657
|
+
<div class='inline'>
|
|
658
|
+
<p>Coste en m2 de la producción del plato.</p>
|
|
659
|
+
</div>
|
|
660
|
+
|
|
661
|
+
</li>
|
|
662
|
+
|
|
663
|
+
</ul>
|
|
664
|
+
|
|
665
|
+
</div><table class="source_code">
|
|
666
|
+
<tr>
|
|
667
|
+
<td>
|
|
668
|
+
<pre class="lines">
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
33
|
|
672
|
+
34
|
|
673
|
+
35
|
|
674
|
+
36
|
|
675
|
+
37
|
|
676
|
+
38
|
|
677
|
+
39</pre>
|
|
678
|
+
</td>
|
|
679
|
+
<td>
|
|
680
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 33</span>
|
|
681
|
+
|
|
682
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_costeTerreno'>costeTerreno</span>
|
|
683
|
+
<span class='id identifier rubyid_coste'>coste</span><span class='op'>=</span> <span class='float'>0.0</span><span class='period'>.</span><span class='id identifier rubyid_to_d'>to_d</span>
|
|
684
|
+
<span class='id identifier rubyid_conjuntoAlimentos'>conjuntoAlimentos</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
|
685
|
+
<span class='id identifier rubyid_coste'>coste</span><span class='op'>+=</span> <span class='lparen'>(</span><span class='id identifier rubyid_conjuntoAlimentos'>conjuntoAlimentos</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_costeTerreno'>costeTerreno</span><span class='period'>.</span><span class='id identifier rubyid_to_d'>to_d</span><span class='rparen'>)</span><span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_conjuntoCantidades'>conjuntoCantidades</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_to_d'>to_d</span><span class='op'>/</span><span class='float'>1000.0</span><span class='rparen'>)</span>
|
|
686
|
+
<span class='kw'>end</span>
|
|
687
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_coste'>coste</span>
|
|
688
|
+
<span class='kw'>end</span></pre>
|
|
689
|
+
</td>
|
|
690
|
+
</tr>
|
|
691
|
+
</table>
|
|
692
|
+
</div>
|
|
693
|
+
|
|
694
|
+
<div class="method_details ">
|
|
695
|
+
<h3 class="signature " id="eficienciaEnergetica-instance_method">
|
|
696
|
+
|
|
697
|
+
#<strong>eficienciaEnergetica</strong> ⇒ <tt>Double</tt>
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
</h3><div class="docstring">
|
|
704
|
+
<div class="discussion">
|
|
705
|
+
|
|
706
|
+
<p>Eficiencia energética del plato (kilocalorias)</p>
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
</div>
|
|
710
|
+
</div>
|
|
711
|
+
<div class="tags">
|
|
712
|
+
|
|
713
|
+
<p class="tag_title">Returns:</p>
|
|
714
|
+
<ul class="return">
|
|
715
|
+
|
|
716
|
+
<li>
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
<span class='type'>(<tt>Double</tt>)</span>
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
—
|
|
724
|
+
<div class='inline'>
|
|
725
|
+
<p>Kilocalorias producidas por el plato</p>
|
|
726
|
+
</div>
|
|
727
|
+
|
|
728
|
+
</li>
|
|
729
|
+
|
|
730
|
+
</ul>
|
|
731
|
+
|
|
732
|
+
</div><table class="source_code">
|
|
733
|
+
<tr>
|
|
734
|
+
<td>
|
|
735
|
+
<pre class="lines">
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
46
|
|
739
|
+
47
|
|
740
|
+
48
|
|
741
|
+
49
|
|
742
|
+
50
|
|
743
|
+
51
|
|
744
|
+
52</pre>
|
|
745
|
+
</td>
|
|
746
|
+
<td>
|
|
747
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 46</span>
|
|
748
|
+
|
|
749
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_eficienciaEnergetica'>eficienciaEnergetica</span>
|
|
750
|
+
<span class='id identifier rubyid_eficiencia'>eficiencia</span><span class='op'>=</span> <span class='float'>0.0</span><span class='period'>.</span><span class='id identifier rubyid_to_d'>to_d</span>
|
|
751
|
+
<span class='id identifier rubyid_conjuntoAlimentos'>conjuntoAlimentos</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
|
752
|
+
<span class='id identifier rubyid_eficiencia'>eficiencia</span><span class='op'>+=</span> <span class='lparen'>(</span><span class='id identifier rubyid_conjuntoAlimentos'>conjuntoAlimentos</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_kilocalorias'>kilocalorias</span><span class='period'>.</span><span class='id identifier rubyid_to_d'>to_d</span><span class='rparen'>)</span><span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_conjuntoCantidades'>conjuntoCantidades</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_to_d'>to_d</span><span class='op'>/</span><span class='float'>1000.0</span><span class='rparen'>)</span>
|
|
753
|
+
<span class='kw'>end</span>
|
|
754
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_eficiencia'>eficiencia</span>
|
|
755
|
+
<span class='kw'>end</span></pre>
|
|
756
|
+
</td>
|
|
757
|
+
</tr>
|
|
758
|
+
</table>
|
|
759
|
+
</div>
|
|
760
|
+
|
|
761
|
+
<div class="method_details ">
|
|
762
|
+
<h3 class="signature " id="emisionInvernadero-instance_method">
|
|
763
|
+
|
|
764
|
+
#<strong>emisionInvernadero</strong> ⇒ <tt>Double</tt>
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
</h3><div class="docstring">
|
|
771
|
+
<div class="discussion">
|
|
772
|
+
|
|
773
|
+
<p>Cantidad de gases de efecto invernadero liberados por el plato en cuestión.</p>
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
</div>
|
|
777
|
+
</div>
|
|
778
|
+
<div class="tags">
|
|
779
|
+
|
|
780
|
+
<p class="tag_title">Returns:</p>
|
|
781
|
+
<ul class="return">
|
|
782
|
+
|
|
783
|
+
<li>
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
<span class='type'>(<tt>Double</tt>)</span>
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
—
|
|
791
|
+
<div class='inline'>
|
|
792
|
+
<p>Emisiones de efecto ivernaderos emitidas por el plato.</p>
|
|
793
|
+
</div>
|
|
794
|
+
|
|
795
|
+
</li>
|
|
796
|
+
|
|
797
|
+
</ul>
|
|
798
|
+
|
|
799
|
+
</div><table class="source_code">
|
|
800
|
+
<tr>
|
|
801
|
+
<td>
|
|
802
|
+
<pre class="lines">
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
20
|
|
806
|
+
21
|
|
807
|
+
22
|
|
808
|
+
23
|
|
809
|
+
24
|
|
810
|
+
25
|
|
811
|
+
26</pre>
|
|
812
|
+
</td>
|
|
813
|
+
<td>
|
|
814
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 20</span>
|
|
815
|
+
|
|
816
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_emisionInvernadero'>emisionInvernadero</span>
|
|
817
|
+
<span class='id identifier rubyid_emision'>emision</span><span class='op'>=</span> <span class='float'>0.0</span><span class='period'>.</span><span class='id identifier rubyid_to_d'>to_d</span>
|
|
818
|
+
<span class='id identifier rubyid_conjuntoAlimentos'>conjuntoAlimentos</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
|
819
|
+
<span class='id identifier rubyid_emision'>emision</span><span class='op'>+=</span> <span class='lparen'>(</span><span class='id identifier rubyid_conjuntoAlimentos'>conjuntoAlimentos</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='const'>GEI</span><span class='period'>.</span><span class='id identifier rubyid_to_d'>to_d</span><span class='rparen'>)</span><span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_conjuntoCantidades'>conjuntoCantidades</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_to_d'>to_d</span><span class='op'>/</span><span class='float'>100.0</span><span class='rparen'>)</span>
|
|
820
|
+
<span class='kw'>end</span>
|
|
821
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_emision'>emision</span>
|
|
822
|
+
<span class='kw'>end</span></pre>
|
|
823
|
+
</td>
|
|
824
|
+
</tr>
|
|
825
|
+
</table>
|
|
826
|
+
</div>
|
|
827
|
+
|
|
828
|
+
<div class="method_details ">
|
|
829
|
+
<h3 class="signature " id="huellaNutricional-instance_method">
|
|
830
|
+
|
|
831
|
+
#<strong>huellaNutricional</strong> ⇒ <tt>Integer</tt>
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
</h3><div class="docstring">
|
|
838
|
+
<div class="discussion">
|
|
839
|
+
|
|
840
|
+
<p>Devuelve un entero en un rango [1 - 3] que indica el impacto medioambiental
|
|
841
|
+
del plato según su valor calórico total y sus emisiones de efecto
|
|
842
|
+
invernadero.</p>
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
</div>
|
|
846
|
+
</div>
|
|
847
|
+
<div class="tags">
|
|
848
|
+
|
|
849
|
+
<p class="tag_title">Returns:</p>
|
|
850
|
+
<ul class="return">
|
|
851
|
+
|
|
852
|
+
<li>
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
—
|
|
860
|
+
<div class='inline'>
|
|
861
|
+
<p>Huella nutricional del plato (1, 2, 3).</p>
|
|
862
|
+
</div>
|
|
863
|
+
|
|
864
|
+
</li>
|
|
865
|
+
|
|
866
|
+
</ul>
|
|
867
|
+
|
|
868
|
+
</div><table class="source_code">
|
|
869
|
+
<tr>
|
|
870
|
+
<td>
|
|
871
|
+
<pre class="lines">
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
61
|
|
875
|
+
62
|
|
876
|
+
63</pre>
|
|
877
|
+
</td>
|
|
878
|
+
<td>
|
|
879
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 61</span>
|
|
880
|
+
|
|
881
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_huellaNutricional'>huellaNutricional</span>
|
|
882
|
+
<span class='kw'>return</span> <span class='lparen'>(</span><span class='id identifier rubyid_indicadorEnergia'>indicadorEnergia</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='op'>+</span> <span class='id identifier rubyid_indicadorCarbono'>indicadorCarbono</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span><span class='op'>/</span><span class='int'>2</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
|
883
|
+
<span class='kw'>end</span></pre>
|
|
884
|
+
</td>
|
|
885
|
+
</tr>
|
|
886
|
+
</table>
|
|
887
|
+
</div>
|
|
888
|
+
|
|
889
|
+
<div class="method_details ">
|
|
890
|
+
<h3 class="signature " id="indicadorCarbono-instance_method">
|
|
891
|
+
|
|
892
|
+
#<strong>indicadorCarbono</strong> ⇒ <tt>Object</tt>
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
</h3><div class="docstring">
|
|
899
|
+
<div class="discussion">
|
|
900
|
+
|
|
901
|
+
<p>Vease #huellaNutricional</p>
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
</div>
|
|
905
|
+
</div>
|
|
906
|
+
<div class="tags">
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
</div><table class="source_code">
|
|
910
|
+
<tr>
|
|
911
|
+
<td>
|
|
912
|
+
<pre class="lines">
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
81
|
|
916
|
+
82
|
|
917
|
+
83
|
|
918
|
+
84
|
|
919
|
+
85
|
|
920
|
+
86
|
|
921
|
+
87
|
|
922
|
+
88
|
|
923
|
+
89</pre>
|
|
924
|
+
</td>
|
|
925
|
+
<td>
|
|
926
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 81</span>
|
|
927
|
+
|
|
928
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_indicadorCarbono'>indicadorCarbono</span>
|
|
929
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_emisionInvernadero'>emisionInvernadero</span><span class='op'><</span> <span class='int'>800</span><span class='rparen'>)</span>
|
|
930
|
+
<span class='kw'>return</span> <span class='int'>1</span>
|
|
931
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='id identifier rubyid_emisionInvernadero'>emisionInvernadero</span><span class='op'>></span> <span class='int'>1200</span><span class='rparen'>)</span>
|
|
932
|
+
<span class='kw'>return</span> <span class='int'>3</span>
|
|
933
|
+
<span class='kw'>else</span>
|
|
934
|
+
<span class='kw'>return</span> <span class='int'>2</span>
|
|
935
|
+
<span class='kw'>end</span>
|
|
936
|
+
<span class='kw'>end</span></pre>
|
|
937
|
+
</td>
|
|
938
|
+
</tr>
|
|
939
|
+
</table>
|
|
940
|
+
</div>
|
|
941
|
+
|
|
942
|
+
<div class="method_details ">
|
|
943
|
+
<h3 class="signature " id="indicadorEnergia-instance_method">
|
|
944
|
+
|
|
945
|
+
#<strong>indicadorEnergia</strong> ⇒ <tt>Object</tt>
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
</h3><div class="docstring">
|
|
952
|
+
<div class="discussion">
|
|
953
|
+
|
|
954
|
+
<p>Vease #huellaNutricional</p>
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
</div>
|
|
958
|
+
</div>
|
|
959
|
+
<div class="tags">
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
</div><table class="source_code">
|
|
963
|
+
<tr>
|
|
964
|
+
<td>
|
|
965
|
+
<pre class="lines">
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
68
|
|
969
|
+
69
|
|
970
|
+
70
|
|
971
|
+
71
|
|
972
|
+
72
|
|
973
|
+
73
|
|
974
|
+
74
|
|
975
|
+
75
|
|
976
|
+
76</pre>
|
|
977
|
+
</td>
|
|
978
|
+
<td>
|
|
979
|
+
<pre class="code"><span class="info file"># File 'lib/practica6/mejorplatos.rb', line 68</span>
|
|
980
|
+
|
|
981
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_indicadorEnergia'>indicadorEnergia</span>
|
|
982
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_valorCaloricoTotal'>valorCaloricoTotal</span><span class='op'><</span> <span class='int'>670</span><span class='rparen'>)</span>
|
|
983
|
+
<span class='kw'>return</span> <span class='int'>1</span>
|
|
984
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='id identifier rubyid_valorCaloricoTotal'>valorCaloricoTotal</span><span class='op'>></span> <span class='int'>830</span><span class='rparen'>)</span>
|
|
985
|
+
<span class='kw'>return</span> <span class='int'>3</span>
|
|
986
|
+
<span class='kw'>else</span>
|
|
987
|
+
<span class='kw'>return</span> <span class='int'>2</span>
|
|
988
|
+
<span class='kw'>end</span>
|
|
989
|
+
<span class='kw'>end</span></pre>
|
|
990
|
+
</td>
|
|
991
|
+
</tr>
|
|
992
|
+
</table>
|
|
993
|
+
</div>
|
|
994
|
+
|
|
995
|
+
</div>
|
|
996
|
+
|
|
997
|
+
</div>
|
|
998
|
+
|
|
999
|
+
<div id="footer">
|
|
1000
|
+
Generated on Tue Dec 17 19:32:04 2019 by
|
|
1001
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1002
|
+
0.9.20 (ruby-2.5.1).
|
|
1003
|
+
</div>
|
|
1004
|
+
|
|
1005
|
+
</div>
|
|
1006
|
+
</body>
|
|
1007
|
+
</html>
|