alu0100905885 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/.travis.yml +12 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/Alimentos.html +513 -0
- data/doc/CODE_OF_CONDUCT_md.html +192 -0
- data/doc/Gemfile.html +98 -0
- data/doc/LICENSE_txt.html +114 -0
- data/doc/Listas.html +512 -0
- data/doc/Object.html +126 -0
- data/doc/Plato_.html +409 -0
- data/doc/Platos.html +389 -0
- data/doc/Prct6.html +108 -0
- data/doc/Prct6/Error.html +101 -0
- data/doc/README_md.html +169 -0
- data/doc/Rakefile.html +98 -0
- data/doc/bin/setup.html +98 -0
- data/doc/created.rid +16 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +590 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +114 -0
- data/doc/js/darkfish.js +161 -0
- data/doc/js/jquery.js +5 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +229 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/prct6_gemspec.html +129 -0
- data/doc/table_of_contents.html +238 -0
- data/lib/prct6.rb +11 -0
- data/lib/prct6/listas.rb +68 -0
- data/lib/prct6/menu_dsl.rb +33 -0
- data/lib/prct6/plato_dsl.rb +29 -0
- data/lib/prct6/platos.rb +154 -0
- data/lib/prct6/prct6.rb +62 -0
- data/lib/prct6/version.rb +3 -0
- data/pkg/alu0100905885-0.1.0.gem +0 -0
- data/pkg/prct6-0.1.0.gem +0 -0
- data/prct6.gemspec +34 -0
- metadata +208 -0
data/doc/Object.html
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Object - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="class">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="./index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
<div id="parent-class-section" class="nav-section">
|
59
|
+
<h3>Parent</h3>
|
60
|
+
|
61
|
+
|
62
|
+
<p class="link">BasicObject
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<div id="includes-section" class="nav-section">
|
67
|
+
<h3>Included Modules</h3>
|
68
|
+
|
69
|
+
<ul class="link-list">
|
70
|
+
|
71
|
+
|
72
|
+
<li><span class="include">Comparable</span>
|
73
|
+
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-labelledby="class-Object">
|
84
|
+
<h1 id="class-Object" class="class">
|
85
|
+
class Object
|
86
|
+
</h1>
|
87
|
+
|
88
|
+
<section class="description">
|
89
|
+
|
90
|
+
</section>
|
91
|
+
|
92
|
+
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<section class="constants-list">
|
100
|
+
<header>
|
101
|
+
<h3>Constants</h3>
|
102
|
+
</header>
|
103
|
+
<dl>
|
104
|
+
|
105
|
+
<dt id="Nodo">Nodo
|
106
|
+
|
107
|
+
<dd>
|
108
|
+
|
109
|
+
|
110
|
+
</dl>
|
111
|
+
</section>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
</section>
|
118
|
+
</main>
|
119
|
+
|
120
|
+
|
121
|
+
<footer id="validator-badges" role="contentinfo">
|
122
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
123
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.1.
|
124
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
125
|
+
</footer>
|
126
|
+
|
data/doc/Plato_.html
ADDED
@@ -0,0 +1,409 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Plato_ - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="class">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="./index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
<div id="parent-class-section" class="nav-section">
|
59
|
+
<h3>Parent</h3>
|
60
|
+
|
61
|
+
|
62
|
+
<p class="link"><a href="Platos.html">Platos</a>
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
<!-- Method Quickref -->
|
69
|
+
<div id="method-list-section" class="nav-section">
|
70
|
+
<h3>Methods</h3>
|
71
|
+
|
72
|
+
<ul class="link-list" role="directory">
|
73
|
+
|
74
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
75
|
+
|
76
|
+
<li ><a href="#method-i-3C-3D-3E">#<=></a>
|
77
|
+
|
78
|
+
<li ><a href="#method-i-emisiones_plato">#emisiones_plato</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-huella">#huella</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-suma">#suma</a>
|
83
|
+
|
84
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
85
|
+
|
86
|
+
</ul>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
</nav>
|
91
|
+
|
92
|
+
<main role="main" aria-labelledby="class-Plato_">
|
93
|
+
<h1 id="class-Plato_" class="class">
|
94
|
+
class Plato_
|
95
|
+
</h1>
|
96
|
+
|
97
|
+
<section class="description">
|
98
|
+
|
99
|
+
<p>Clase plato_ heredada de clase platos</p>
|
100
|
+
|
101
|
+
</section>
|
102
|
+
|
103
|
+
|
104
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<section class="attribute-method-details" class="method-section">
|
113
|
+
<header>
|
114
|
+
<h3>Attributes</h3>
|
115
|
+
</header>
|
116
|
+
|
117
|
+
|
118
|
+
<div id="attribute-i-cal_total" class="method-detail">
|
119
|
+
<div class="method-heading attribute-method-heading">
|
120
|
+
<span class="method-name">cal_total</span><span
|
121
|
+
class="attribute-access-type">[R]</span>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div class="method-description">
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
</section>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
136
|
+
<header>
|
137
|
+
<h3>Public Class Methods</h3>
|
138
|
+
</header>
|
139
|
+
|
140
|
+
|
141
|
+
<div id="method-c-new" class="method-detail ">
|
142
|
+
|
143
|
+
<div class="method-heading">
|
144
|
+
<span class="method-name">new</span><span
|
145
|
+
class="method-args">(nombre, alimentos, peso, peso_total, cal_array, emisiones_array)</span>
|
146
|
+
|
147
|
+
<span class="method-click-advice">click to toggle source</span>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
<div class="method-description">
|
153
|
+
|
154
|
+
<p>Método initialize Método para inicializar los diferentes atributos de la
|
155
|
+
clase</p>
|
156
|
+
|
157
|
+
|
158
|
+
<div class="method-calls-super">
|
159
|
+
Calls superclass method
|
160
|
+
<a href="Platos.html#method-c-new">Platos.new</a>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
<div class="method-source-code" id="new-source">
|
166
|
+
<pre><span class="ruby-comment"># File lib/prct6/platos.rb, line 71</span>
|
167
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">alimentos</span>, <span class="ruby-identifier">peso</span>, <span class="ruby-identifier">peso_total</span>, <span class="ruby-identifier">cal_array</span>, <span class="ruby-identifier">emisiones_array</span>)
|
168
|
+
|
169
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">alimentos</span>, <span class="ruby-identifier">peso</span>, <span class="ruby-identifier">peso_total</span>, <span class="ruby-identifier">cal_array</span>, <span class="ruby-identifier">emisiones_array</span>)
|
170
|
+
|
171
|
+
<span class="ruby-ivar">@cal_plato</span> = <span class="ruby-identifier">cal_plato</span>
|
172
|
+
<span class="ruby-ivar">@emisiones_plato</span> = <span class="ruby-identifier">emisiones_plato</span>
|
173
|
+
<span class="ruby-ivar">@huella</span> = <span class="ruby-identifier">huella</span>
|
174
|
+
<span class="ruby-keyword">end</span></pre>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
</div>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
</section>
|
186
|
+
|
187
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
188
|
+
<header>
|
189
|
+
<h3>Public Instance Methods</h3>
|
190
|
+
</header>
|
191
|
+
|
192
|
+
|
193
|
+
<div id="method-i-3C-3D-3E" class="method-detail ">
|
194
|
+
|
195
|
+
<div class="method-heading">
|
196
|
+
<span class="method-name"><=></span><span
|
197
|
+
class="method-args">(other)</span>
|
198
|
+
|
199
|
+
<span class="method-click-advice">click to toggle source</span>
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
203
|
+
|
204
|
+
<div class="method-description">
|
205
|
+
|
206
|
+
<p>Método <=> Método para comparar la eficiencia energética entre platos</p>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
<div class="method-source-code" id="3C-3D-3E-source">
|
212
|
+
<pre><span class="ruby-comment"># File lib/prct6/platos.rb, line 149</span>
|
213
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title"><=></span>(<span class="ruby-identifier">other</span>)
|
214
|
+
<span class="ruby-ivar">@cal_plato</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">cal_plato</span>
|
215
|
+
<span class="ruby-keyword">end</span></pre>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
</div>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</div>
|
224
|
+
|
225
|
+
|
226
|
+
<div id="method-i-emisiones_plato" class="method-detail ">
|
227
|
+
|
228
|
+
<div class="method-heading">
|
229
|
+
<span class="method-name">emisiones_plato</span><span
|
230
|
+
class="method-args">()</span>
|
231
|
+
|
232
|
+
<span class="method-click-advice">click to toggle source</span>
|
233
|
+
|
234
|
+
</div>
|
235
|
+
|
236
|
+
|
237
|
+
<div class="method-description">
|
238
|
+
|
239
|
+
<p>Método <a href="Plato_.html#method-i-emisiones_plato">#emisiones_plato</a>
|
240
|
+
Método para calcular la cantidad de emisiones generadas en la realización
|
241
|
+
de un plato @return: Devuelve las emisiones totales de un plato</p>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
<div class="method-source-code" id="emisiones_plato-source">
|
247
|
+
<pre><span class="ruby-comment"># File lib/prct6/platos.rb, line 83</span>
|
248
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">emisiones_plato</span>
|
249
|
+
<span class="ruby-identifier">emisiones_plato</span>=<span class="ruby-value">0</span>
|
250
|
+
<span class="ruby-identifier">i</span>=<span class="ruby-value">0</span>
|
251
|
+
|
252
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">i</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">emisiones_array</span>.<span class="ruby-identifier">length</span> <span class="ruby-keyword">do</span>
|
253
|
+
<span class="ruby-identifier">emisiones_plato</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">emisiones_array</span>[<span class="ruby-identifier">i</span>]
|
254
|
+
<span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
255
|
+
<span class="ruby-keyword">end</span>
|
256
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">emisiones_plato</span>
|
257
|
+
<span class="ruby-keyword">end</span></pre>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
</div>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
</div>
|
266
|
+
|
267
|
+
|
268
|
+
<div id="method-i-huella" class="method-detail ">
|
269
|
+
|
270
|
+
<div class="method-heading">
|
271
|
+
<span class="method-name">huella</span><span
|
272
|
+
class="method-args">()</span>
|
273
|
+
|
274
|
+
<span class="method-click-advice">click to toggle source</span>
|
275
|
+
|
276
|
+
</div>
|
277
|
+
|
278
|
+
|
279
|
+
<div class="method-description">
|
280
|
+
|
281
|
+
<p>Método huella Método para hallar la huella nutricional de cada plato
|
282
|
+
@return: Devuelve la huella generada; un valor comprendido entre 1 y 3</p>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
<div class="method-source-code" id="huella-source">
|
288
|
+
<pre><span class="ruby-comment"># File lib/prct6/platos.rb, line 100</span>
|
289
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">huella</span>
|
290
|
+
<span class="ruby-ivar">@huella_e</span>
|
291
|
+
|
292
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@cal_plato</span> <span class="ruby-operator"><=</span> <span class="ruby-value">670</span>
|
293
|
+
<span class="ruby-ivar">@huella_e</span> = <span class="ruby-value">1.0</span>
|
294
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@cal_plato</span> <span class="ruby-operator">></span> <span class="ruby-value">670</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@cal_plato</span> <span class="ruby-operator"><=</span> <span class="ruby-value">830</span>
|
295
|
+
<span class="ruby-ivar">@huella_e</span> = <span class="ruby-value">2.0</span>
|
296
|
+
<span class="ruby-keyword">else</span>
|
297
|
+
<span class="ruby-ivar">@huella_e</span> = <span class="ruby-value">3.0</span>
|
298
|
+
<span class="ruby-keyword">end</span>
|
299
|
+
|
300
|
+
<span class="ruby-ivar">@huella_c</span>
|
301
|
+
|
302
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@emisiones_plato</span> <span class="ruby-operator"><=</span> <span class="ruby-value">670</span>
|
303
|
+
<span class="ruby-ivar">@huella_c</span> = <span class="ruby-value">1.0</span>
|
304
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@emisiones_plato</span> <span class="ruby-operator">></span> <span class="ruby-value">670</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@emisiones_plato</span> <span class="ruby-operator"><=</span> <span class="ruby-value">830</span>
|
305
|
+
<span class="ruby-ivar">@huella_c</span> = <span class="ruby-value">2.0</span>
|
306
|
+
<span class="ruby-keyword">else</span>
|
307
|
+
<span class="ruby-ivar">@huella_c</span> = <span class="ruby-value">3.0</span>
|
308
|
+
<span class="ruby-keyword">end</span>
|
309
|
+
|
310
|
+
<span class="ruby-keyword">return</span> (<span class="ruby-ivar">@huella_e</span><span class="ruby-operator">+</span><span class="ruby-ivar">@huella_c</span>)<span class="ruby-operator">/</span><span class="ruby-value">2</span>
|
311
|
+
<span class="ruby-keyword">end</span></pre>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
</div>
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
</div>
|
320
|
+
|
321
|
+
|
322
|
+
<div id="method-i-suma" class="method-detail ">
|
323
|
+
|
324
|
+
<div class="method-heading">
|
325
|
+
<span class="method-name">suma</span><span
|
326
|
+
class="method-args">(alimentos)</span>
|
327
|
+
|
328
|
+
<span class="method-click-advice">click to toggle source</span>
|
329
|
+
|
330
|
+
</div>
|
331
|
+
|
332
|
+
|
333
|
+
<div class="method-description">
|
334
|
+
|
335
|
+
<p>Método suma Método anteriormente utilizado para calcular todas las sumas,
|
336
|
+
que ahora solo ocupa la suma del terreno ocupado @return: La suma del array
|
337
|
+
de entrada</p>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
<div class="method-source-code" id="suma-source">
|
343
|
+
<pre><span class="ruby-comment"># File lib/prct6/platos.rb, line 128</span>
|
344
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">suma</span>(<span class="ruby-identifier">alimentos</span>)
|
345
|
+
<span class="ruby-identifier">total</span>=<span class="ruby-value">0</span>
|
346
|
+
<span class="ruby-identifier">i</span>=<span class="ruby-value">0</span>
|
347
|
+
|
348
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">i</span><span class="ruby-operator"><</span><span class="ruby-identifier">alimentos</span>.<span class="ruby-identifier">length</span> <span class="ruby-keyword">do</span>
|
349
|
+
<span class="ruby-identifier">total</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">alimentos</span>[<span class="ruby-identifier">i</span>]
|
350
|
+
<span class="ruby-identifier">i</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
351
|
+
<span class="ruby-keyword">end</span>
|
352
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">total</span>
|
353
|
+
<span class="ruby-keyword">end</span></pre>
|
354
|
+
</div>
|
355
|
+
|
356
|
+
</div>
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
</div>
|
362
|
+
|
363
|
+
|
364
|
+
<div id="method-i-to_s" class="method-detail ">
|
365
|
+
|
366
|
+
<div class="method-heading">
|
367
|
+
<span class="method-name">to_s</span><span
|
368
|
+
class="method-args">()</span>
|
369
|
+
|
370
|
+
<span class="method-click-advice">click to toggle source</span>
|
371
|
+
|
372
|
+
</div>
|
373
|
+
|
374
|
+
|
375
|
+
<div class="method-description">
|
376
|
+
|
377
|
+
<p>Método <a href="Plato_.html#method-i-to_s">#to_s</a> Método para sacar
|
378
|
+
informacion formateada</p>
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
<div class="method-source-code" id="to_s-source">
|
384
|
+
<pre><span class="ruby-comment"># File lib/prct6/platos.rb, line 142</span>
|
385
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
|
386
|
+
<span class="ruby-keyword">return</span> <span class="ruby-node">"Eficiencia = #{cal_plato}"</span>
|
387
|
+
<span class="ruby-keyword">end</span></pre>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
</div>
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
</div>
|
396
|
+
|
397
|
+
|
398
|
+
</section>
|
399
|
+
|
400
|
+
</section>
|
401
|
+
</main>
|
402
|
+
|
403
|
+
|
404
|
+
<footer id="validator-badges" role="contentinfo">
|
405
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
406
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.1.
|
407
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
408
|
+
</footer>
|
409
|
+
|