foodAIHE 3.3.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/.gitignore +12 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +70 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/DLLModule/DLL.html +1185 -0
- data/docs/DLLModule/Node.html +409 -0
- data/docs/DLLModule.html +126 -0
- data/docs/Food.html +567 -0
- data/docs/FoodAbstract.html +807 -0
- data/docs/FoodGem.html +156 -0
- data/docs/_config.yml +1 -0
- data/docs/_index.html +154 -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 +492 -0
- data/docs/file.README.html +161 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +161 -0
- data/docs/input/food-data.txt +19 -0
- data/docs/input/samples-data.txt +9 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +267 -0
- data/docs/top-level-namespace.html +297 -0
- data/food.gemspec +41 -0
- data/lib/food/dll.rb +168 -0
- data/lib/food/food_class.rb +132 -0
- data/lib/food/version.rb +6 -0
- data/lib/food.rb +91 -0
- metadata +165 -0
@@ -0,0 +1,807 @@
|
|
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: FoodAbstract
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
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 = "FoodAbstract";
|
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 (F)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">FoodAbstract</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: FoodAbstract
|
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">FoodAbstract</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/food/food_class.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Abstract class for Food</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="Food.html" title="Food (class)">Food</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="#energetic_content-instance_method" title="#energetic_content (instance method)">#<strong>energetic_content</strong> ⇒ Object </a>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
</span>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="note title readonly">readonly</span>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
147
|
+
|
148
|
+
</li>
|
149
|
+
|
150
|
+
|
151
|
+
<li class="public ">
|
152
|
+
<span class="summary_signature">
|
153
|
+
|
154
|
+
<a href="#glucid_quantity-instance_method" title="#glucid_quantity (instance method)">#<strong>glucid_quantity</strong> ⇒ Object </a>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
</span>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<span class="note title readonly">readonly</span>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
|
177
|
+
|
178
|
+
<li class="public ">
|
179
|
+
<span class="summary_signature">
|
180
|
+
|
181
|
+
<a href="#lipid_quantity-instance_method" title="#lipid_quantity (instance method)">#<strong>lipid_quantity</strong> ⇒ Object </a>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</span>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
<span class="note title readonly">readonly</span>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
|
205
|
+
<li class="public ">
|
206
|
+
<span class="summary_signature">
|
207
|
+
|
208
|
+
<a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> ⇒ Object </a>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</span>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
<span class="note title readonly">readonly</span>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
228
|
+
|
229
|
+
</li>
|
230
|
+
|
231
|
+
|
232
|
+
<li class="public ">
|
233
|
+
<span class="summary_signature">
|
234
|
+
|
235
|
+
<a href="#protein_quantity-instance_method" title="#protein_quantity (instance method)">#<strong>protein_quantity</strong> ⇒ Object </a>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
<span class="note title readonly">readonly</span>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
255
|
+
|
256
|
+
</li>
|
257
|
+
|
258
|
+
|
259
|
+
</ul>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
<h2>
|
266
|
+
Instance Method Summary
|
267
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
268
|
+
</h2>
|
269
|
+
|
270
|
+
<ul class="summary">
|
271
|
+
|
272
|
+
<li class="public ">
|
273
|
+
<span class="summary_signature">
|
274
|
+
|
275
|
+
<a href="#calculate_energetic_content-instance_method" title="#calculate_energetic_content (instance method)">#<strong>calculate_energetic_content</strong> ⇒ double </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>Calculates the energetic content for the food.</p>
|
291
|
+
</div></span>
|
292
|
+
|
293
|
+
</li>
|
294
|
+
|
295
|
+
|
296
|
+
<li class="public ">
|
297
|
+
<span class="summary_signature">
|
298
|
+
|
299
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, protein_energy_pair, glucid_energy_pair, lipid_energy_pair) ⇒ FoodAbstract </a>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
</span>
|
304
|
+
|
305
|
+
|
306
|
+
<span class="note title constructor">constructor</span>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
<span class="summary_desc"><div class='inline'>
|
316
|
+
<p>Constructor of Abstract Food for allowing the childs to call it.</p>
|
317
|
+
</div></span>
|
318
|
+
|
319
|
+
</li>
|
320
|
+
|
321
|
+
|
322
|
+
<li class="public ">
|
323
|
+
<span class="summary_signature">
|
324
|
+
|
325
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> ⇒ String </a>
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</span>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
<span class="summary_desc"><div class='inline'>
|
340
|
+
<p>Return string with the output for the food.</p>
|
341
|
+
</div></span>
|
342
|
+
|
343
|
+
</li>
|
344
|
+
|
345
|
+
|
346
|
+
</ul>
|
347
|
+
|
348
|
+
|
349
|
+
<div id="constructor_details" class="method_details_list">
|
350
|
+
<h2>Constructor Details</h2>
|
351
|
+
|
352
|
+
<div class="method_details first">
|
353
|
+
<h3 class="signature first" id="initialize-instance_method">
|
354
|
+
|
355
|
+
#<strong>initialize</strong>(name, protein_energy_pair, glucid_energy_pair, lipid_energy_pair) ⇒ <tt><span class='object_link'><a href="" title="FoodAbstract (class)">FoodAbstract</a></span></tt>
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
</h3><div class="docstring">
|
362
|
+
<div class="discussion">
|
363
|
+
|
364
|
+
<p>Constructor of Abstract Food for allowing the childs to call it.</p>
|
365
|
+
|
366
|
+
|
367
|
+
</div>
|
368
|
+
</div>
|
369
|
+
<div class="tags">
|
370
|
+
<p class="tag_title">Parameters:</p>
|
371
|
+
<ul class="param">
|
372
|
+
|
373
|
+
<li>
|
374
|
+
|
375
|
+
<span class='name'>name</span>
|
376
|
+
|
377
|
+
|
378
|
+
<span class='type'>(<tt>String</tt>)</span>
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
—
|
383
|
+
<div class='inline'>
|
384
|
+
<p>the name for the food.</p>
|
385
|
+
</div>
|
386
|
+
|
387
|
+
</li>
|
388
|
+
|
389
|
+
<li>
|
390
|
+
|
391
|
+
<span class='name'>protein_energy_pair</span>
|
392
|
+
|
393
|
+
|
394
|
+
<span class='type'>(<tt>pair</tt>)</span>
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
—
|
399
|
+
<div class='inline'>
|
400
|
+
<p>pair of protein number and energy.</p>
|
401
|
+
</div>
|
402
|
+
|
403
|
+
</li>
|
404
|
+
|
405
|
+
<li>
|
406
|
+
|
407
|
+
<span class='name'>glucid_energy_pair</span>
|
408
|
+
|
409
|
+
|
410
|
+
<span class='type'>(<tt>pair</tt>)</span>
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
—
|
415
|
+
<div class='inline'>
|
416
|
+
<p>pair of glucid number and energy</p>
|
417
|
+
</div>
|
418
|
+
|
419
|
+
</li>
|
420
|
+
|
421
|
+
<li>
|
422
|
+
|
423
|
+
<span class='name'>lipid_energy_pair</span>
|
424
|
+
|
425
|
+
|
426
|
+
<span class='type'>(<tt>pair</tt>)</span>
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
—
|
431
|
+
<div class='inline'>
|
432
|
+
<p>pair of lipid number and energy</p>
|
433
|
+
</div>
|
434
|
+
|
435
|
+
</li>
|
436
|
+
|
437
|
+
</ul>
|
438
|
+
|
439
|
+
|
440
|
+
</div><table class="source_code">
|
441
|
+
<tr>
|
442
|
+
<td>
|
443
|
+
<pre class="lines">
|
444
|
+
|
445
|
+
|
446
|
+
23
|
447
|
+
24
|
448
|
+
25
|
449
|
+
26
|
450
|
+
27
|
451
|
+
28
|
452
|
+
29
|
453
|
+
30
|
454
|
+
31
|
455
|
+
32
|
456
|
+
33
|
457
|
+
34
|
458
|
+
35
|
459
|
+
36
|
460
|
+
37
|
461
|
+
38
|
462
|
+
39
|
463
|
+
40
|
464
|
+
41
|
465
|
+
42
|
466
|
+
43
|
467
|
+
44</pre>
|
468
|
+
</td>
|
469
|
+
<td>
|
470
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 23</span>
|
471
|
+
|
472
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_protein_energy_pair'>protein_energy_pair</span><span class='comma'>,</span> <span class='id identifier rubyid_glucid_energy_pair'>glucid_energy_pair</span><span class='comma'>,</span> <span class='id identifier rubyid_lipid_energy_pair'>lipid_energy_pair</span><span class='rparen'>)</span>
|
473
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='kw'>unless</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
|
474
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_protein_energy_pair'>protein_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_glucid_energy_pair'>glucid_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_lipid_energy_pair'>lipid_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
475
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='kw'>unless</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_protein_energy_pair'>protein_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='int'>2</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_glucid_energy_pair'>glucid_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='int'>2</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_lipid_energy_pair'>lipid_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='int'>2</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
476
|
+
|
477
|
+
<span class='id identifier rubyid_protein_energy_pair'>protein_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span> <span class='id identifier rubyid_raise'>raise</span> <span class='kw'>unless</span> <span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Float</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
478
|
+
<span class='id identifier rubyid_glucid_energy_pair'>glucid_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span> <span class='id identifier rubyid_raise'>raise</span> <span class='kw'>unless</span> <span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Float</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
479
|
+
<span class='id identifier rubyid_lipid_energy_pair'>lipid_energy_pair</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span> <span class='id identifier rubyid_raise'>raise</span> <span class='kw'>unless</span> <span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Float</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
480
|
+
|
481
|
+
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
|
482
|
+
<span class='ivar'>@protein_quantity</span> <span class='op'>=</span> <span class='id identifier rubyid_protein_energy_pair'>protein_energy_pair</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
483
|
+
<span class='ivar'>@glucid_quantity</span> <span class='op'>=</span> <span class='id identifier rubyid_glucid_energy_pair'>glucid_energy_pair</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
484
|
+
<span class='ivar'>@lipid_quantity</span> <span class='op'>=</span> <span class='id identifier rubyid_lipid_energy_pair'>lipid_energy_pair</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
485
|
+
|
486
|
+
<span class='comment'># Vector de pares, pues hash no permite iguales
|
487
|
+
</span> <span class='ivar'>@pair_macronutrient_energy</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
488
|
+
<span class='ivar'>@pair_macronutrient_energy</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_protein_energy_pair'>protein_energy_pair</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_protein_energy_pair'>protein_energy_pair</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
489
|
+
<span class='ivar'>@pair_macronutrient_energy</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_glucid_energy_pair'>glucid_energy_pair</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_glucid_energy_pair'>glucid_energy_pair</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
490
|
+
<span class='ivar'>@pair_macronutrient_energy</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_lipid_energy_pair'>lipid_energy_pair</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_lipid_energy_pair'>lipid_energy_pair</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
491
|
+
|
492
|
+
<span class='ivar'>@energetic_content</span> <span class='op'>=</span> <span class='id identifier rubyid_calculate_energetic_content'>calculate_energetic_content</span>
|
493
|
+
<span class='kw'>end</span></pre>
|
494
|
+
</td>
|
495
|
+
</tr>
|
496
|
+
</table>
|
497
|
+
</div>
|
498
|
+
|
499
|
+
</div>
|
500
|
+
|
501
|
+
<div id="instance_attr_details" class="attr_details">
|
502
|
+
<h2>Instance Attribute Details</h2>
|
503
|
+
|
504
|
+
|
505
|
+
<span id=""></span>
|
506
|
+
<div class="method_details first">
|
507
|
+
<h3 class="signature first" id="energetic_content-instance_method">
|
508
|
+
|
509
|
+
#<strong>energetic_content</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
</h3><table class="source_code">
|
516
|
+
<tr>
|
517
|
+
<td>
|
518
|
+
<pre class="lines">
|
519
|
+
|
520
|
+
|
521
|
+
16
|
522
|
+
17
|
523
|
+
18</pre>
|
524
|
+
</td>
|
525
|
+
<td>
|
526
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 16</span>
|
527
|
+
|
528
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_energetic_content'>energetic_content</span>
|
529
|
+
<span class='ivar'>@energetic_content</span>
|
530
|
+
<span class='kw'>end</span></pre>
|
531
|
+
</td>
|
532
|
+
</tr>
|
533
|
+
</table>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
|
537
|
+
<span id=""></span>
|
538
|
+
<div class="method_details ">
|
539
|
+
<h3 class="signature " id="glucid_quantity-instance_method">
|
540
|
+
|
541
|
+
#<strong>glucid_quantity</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
</h3><table class="source_code">
|
548
|
+
<tr>
|
549
|
+
<td>
|
550
|
+
<pre class="lines">
|
551
|
+
|
552
|
+
|
553
|
+
16
|
554
|
+
17
|
555
|
+
18</pre>
|
556
|
+
</td>
|
557
|
+
<td>
|
558
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 16</span>
|
559
|
+
|
560
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_glucid_quantity'>glucid_quantity</span>
|
561
|
+
<span class='ivar'>@glucid_quantity</span>
|
562
|
+
<span class='kw'>end</span></pre>
|
563
|
+
</td>
|
564
|
+
</tr>
|
565
|
+
</table>
|
566
|
+
</div>
|
567
|
+
|
568
|
+
|
569
|
+
<span id=""></span>
|
570
|
+
<div class="method_details ">
|
571
|
+
<h3 class="signature " id="lipid_quantity-instance_method">
|
572
|
+
|
573
|
+
#<strong>lipid_quantity</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
</h3><table class="source_code">
|
580
|
+
<tr>
|
581
|
+
<td>
|
582
|
+
<pre class="lines">
|
583
|
+
|
584
|
+
|
585
|
+
16
|
586
|
+
17
|
587
|
+
18</pre>
|
588
|
+
</td>
|
589
|
+
<td>
|
590
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 16</span>
|
591
|
+
|
592
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_lipid_quantity'>lipid_quantity</span>
|
593
|
+
<span class='ivar'>@lipid_quantity</span>
|
594
|
+
<span class='kw'>end</span></pre>
|
595
|
+
</td>
|
596
|
+
</tr>
|
597
|
+
</table>
|
598
|
+
</div>
|
599
|
+
|
600
|
+
|
601
|
+
<span id=""></span>
|
602
|
+
<div class="method_details ">
|
603
|
+
<h3 class="signature " id="name-instance_method">
|
604
|
+
|
605
|
+
#<strong>name</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
</h3><table class="source_code">
|
612
|
+
<tr>
|
613
|
+
<td>
|
614
|
+
<pre class="lines">
|
615
|
+
|
616
|
+
|
617
|
+
16
|
618
|
+
17
|
619
|
+
18</pre>
|
620
|
+
</td>
|
621
|
+
<td>
|
622
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 16</span>
|
623
|
+
|
624
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
625
|
+
<span class='ivar'>@name</span>
|
626
|
+
<span class='kw'>end</span></pre>
|
627
|
+
</td>
|
628
|
+
</tr>
|
629
|
+
</table>
|
630
|
+
</div>
|
631
|
+
|
632
|
+
|
633
|
+
<span id=""></span>
|
634
|
+
<div class="method_details ">
|
635
|
+
<h3 class="signature " id="protein_quantity-instance_method">
|
636
|
+
|
637
|
+
#<strong>protein_quantity</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
</h3><table class="source_code">
|
644
|
+
<tr>
|
645
|
+
<td>
|
646
|
+
<pre class="lines">
|
647
|
+
|
648
|
+
|
649
|
+
16
|
650
|
+
17
|
651
|
+
18</pre>
|
652
|
+
</td>
|
653
|
+
<td>
|
654
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 16</span>
|
655
|
+
|
656
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_protein_quantity'>protein_quantity</span>
|
657
|
+
<span class='ivar'>@protein_quantity</span>
|
658
|
+
<span class='kw'>end</span></pre>
|
659
|
+
</td>
|
660
|
+
</tr>
|
661
|
+
</table>
|
662
|
+
</div>
|
663
|
+
|
664
|
+
</div>
|
665
|
+
|
666
|
+
|
667
|
+
<div id="instance_method_details" class="method_details_list">
|
668
|
+
<h2>Instance Method Details</h2>
|
669
|
+
|
670
|
+
|
671
|
+
<div class="method_details first">
|
672
|
+
<h3 class="signature first" id="calculate_energetic_content-instance_method">
|
673
|
+
|
674
|
+
#<strong>calculate_energetic_content</strong> ⇒ <tt>double</tt>
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
</h3><div class="docstring">
|
681
|
+
<div class="discussion">
|
682
|
+
|
683
|
+
<p>Calculates the energetic content for the food</p>
|
684
|
+
|
685
|
+
|
686
|
+
</div>
|
687
|
+
</div>
|
688
|
+
<div class="tags">
|
689
|
+
|
690
|
+
<p class="tag_title">Returns:</p>
|
691
|
+
<ul class="return">
|
692
|
+
|
693
|
+
<li>
|
694
|
+
|
695
|
+
|
696
|
+
<span class='type'>(<tt>double</tt>)</span>
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
—
|
701
|
+
<div class='inline'>
|
702
|
+
<p>energetic_content</p>
|
703
|
+
</div>
|
704
|
+
|
705
|
+
</li>
|
706
|
+
|
707
|
+
</ul>
|
708
|
+
|
709
|
+
</div><table class="source_code">
|
710
|
+
<tr>
|
711
|
+
<td>
|
712
|
+
<pre class="lines">
|
713
|
+
|
714
|
+
|
715
|
+
48
|
716
|
+
49
|
717
|
+
50
|
718
|
+
51
|
719
|
+
52</pre>
|
720
|
+
</td>
|
721
|
+
<td>
|
722
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 48</span>
|
723
|
+
|
724
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_calculate_energetic_content'>calculate_energetic_content</span>
|
725
|
+
<span class='id identifier rubyid_energetic_content'>energetic_content</span> <span class='op'>=</span> <span class='int'>0</span>
|
726
|
+
<span class='ivar'>@pair_macronutrient_energy</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_macronutrient'>macronutrient</span><span class='comma'>,</span> <span class='id identifier rubyid_energy'>energy</span><span class='op'>|</span> <span class='id identifier rubyid_energetic_content'>energetic_content</span> <span class='op'>+=</span> <span class='lparen'>(</span><span class='id identifier rubyid_macronutrient'>macronutrient</span> <span class='op'>*</span> <span class='id identifier rubyid_energy'>energy</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
727
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_energetic_content'>energetic_content</span>
|
728
|
+
<span class='kw'>end</span></pre>
|
729
|
+
</td>
|
730
|
+
</tr>
|
731
|
+
</table>
|
732
|
+
</div>
|
733
|
+
|
734
|
+
<div class="method_details ">
|
735
|
+
<h3 class="signature " id="to_s-instance_method">
|
736
|
+
|
737
|
+
#<strong>to_s</strong> ⇒ <tt>String</tt>
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
|
742
|
+
|
743
|
+
</h3><div class="docstring">
|
744
|
+
<div class="discussion">
|
745
|
+
|
746
|
+
<p>Return string with the output for the food</p>
|
747
|
+
|
748
|
+
|
749
|
+
</div>
|
750
|
+
</div>
|
751
|
+
<div class="tags">
|
752
|
+
|
753
|
+
<p class="tag_title">Returns:</p>
|
754
|
+
<ul class="return">
|
755
|
+
|
756
|
+
<li>
|
757
|
+
|
758
|
+
|
759
|
+
<span class='type'>(<tt>String</tt>)</span>
|
760
|
+
|
761
|
+
|
762
|
+
|
763
|
+
—
|
764
|
+
<div class='inline'>
|
765
|
+
<p>outpout of food</p>
|
766
|
+
</div>
|
767
|
+
|
768
|
+
</li>
|
769
|
+
|
770
|
+
</ul>
|
771
|
+
|
772
|
+
</div><table class="source_code">
|
773
|
+
<tr>
|
774
|
+
<td>
|
775
|
+
<pre class="lines">
|
776
|
+
|
777
|
+
|
778
|
+
56
|
779
|
+
57
|
780
|
+
58
|
781
|
+
59</pre>
|
782
|
+
</td>
|
783
|
+
<td>
|
784
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 56</span>
|
785
|
+
|
786
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
787
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Nombre: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@name</span><span class='embexpr_end'>}</span><span class='tstring_content'> | Proteínas: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@protein_quantity</span><span class='embexpr_end'>}</span><span class='tstring_content'> gramos | Glúcidos: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@glucid_quantity</span><span class='embexpr_end'>}</span><span class='tstring_content'> gramos | Lípidos: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@lipid_quantity</span><span class='embexpr_end'>}</span><span class='tstring_content'> gramos | </span><span class='tstring_end'>"</span></span> \
|
788
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Contenido Energético: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@energetic_content</span><span class='embexpr_end'>}</span><span class='tstring_content'> Kcal.</span><span class='tstring_end'>"</span></span>
|
789
|
+
<span class='kw'>end</span></pre>
|
790
|
+
</td>
|
791
|
+
</tr>
|
792
|
+
</table>
|
793
|
+
</div>
|
794
|
+
|
795
|
+
</div>
|
796
|
+
|
797
|
+
</div>
|
798
|
+
|
799
|
+
<div id="footer">
|
800
|
+
Generated on Wed Nov 15 11:48:21 2017 by
|
801
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
802
|
+
0.9.9 (ruby-2.3.0).
|
803
|
+
</div>
|
804
|
+
|
805
|
+
</div>
|
806
|
+
</body>
|
807
|
+
</html>
|