alimento-alu0100946499 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +45 -0
- data/Rakefile +66 -0
- data/alimento.gemspec +29 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Alimento.html +129 -0
- data/docs/Alimento/AliGra.html +181 -0
- data/docs/Alimento/AliRicCar.html +181 -0
- data/docs/Alimento/Alimento.html +474 -0
- data/docs/Alimento/Bebidas.html +181 -0
- data/docs/Alimento/CarDer.html +181 -0
- data/docs/Alimento/Frutas.html +181 -0
- data/docs/Alimento/HueLacHel.html +181 -0
- data/docs/Alimento/PesMar.html +181 -0
- data/docs/Alimento/Plato.html +368 -0
- data/docs/Alimento/VerHor.html +181 -0
- data/docs/Array.html +200 -0
- data/docs/DLL.html +124 -0
- data/docs/DLL/DLL.html +510 -0
- data/docs/created.rid +8 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +590 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +106 -0
- data/docs/js/darkfish.js +161 -0
- data/docs/js/jquery.js +4 -0
- data/docs/js/navigation.js +142 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +109 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +228 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +223 -0
- data/lib/DLL/fuente.rb +107 -0
- data/lib/DLL/version.rb +3 -0
- data/lib/alimento.rb +17 -0
- data/lib/alimento/fuente.rb +216 -0
- data/lib/alimento/version.rb +3 -0
- data/lib/array/fuente.rb +24 -0
- data/lib/plato/fuente.rb +75 -0
- metadata +221 -0
@@ -0,0 +1,181 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Alimento::AliGra - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script src="../js/jquery.js"></script>
|
14
|
+
<script src="../js/darkfish.js"></script>
|
15
|
+
|
16
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
17
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<body id="top" role="document" class="class">
|
22
|
+
<nav role="navigation">
|
23
|
+
<div id="project-navigation">
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
25
|
+
<h2>
|
26
|
+
<a href="../index.html" rel="home">Home</a>
|
27
|
+
</h2>
|
28
|
+
|
29
|
+
<div id="table-of-contents-navigation">
|
30
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
31
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
32
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
38
|
+
<div id="search-field-wrapper">
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
46
|
+
aria-busy="false" aria-expanded="false"
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
48
|
+
</form>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<div id="class-metadata">
|
56
|
+
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
58
|
+
<h3>Parent</h3>
|
59
|
+
|
60
|
+
|
61
|
+
<p class="link"><a href="Alimento.html">Alimento::Alimento</a>
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<div id="method-list-section" class="nav-section">
|
69
|
+
<h3>Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list" role="directory">
|
72
|
+
|
73
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
<main role="main" aria-labelledby="class-Alimento::AliGra">
|
82
|
+
<h1 id="class-Alimento::AliGra" class="class">
|
83
|
+
class Alimento::AliGra
|
84
|
+
</h1>
|
85
|
+
|
86
|
+
<section class="description">
|
87
|
+
|
88
|
+
</section>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<section class="attribute-method-details" class="method-section">
|
102
|
+
<header>
|
103
|
+
<h3>Attributes</h3>
|
104
|
+
</header>
|
105
|
+
|
106
|
+
|
107
|
+
<div id="attribute-i-grupo" class="method-detail">
|
108
|
+
<div class="method-heading attribute-method-heading">
|
109
|
+
<span class="method-name">grupo</span><span
|
110
|
+
class="attribute-access-type">[R]</span>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<div class="method-description">
|
114
|
+
|
115
|
+
<p>Esta clase permite representar alimentos dentro del grupo “Alimentos
|
116
|
+
Grasos”. Hereda de la clase alimento.</p>
|
117
|
+
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
</section>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
126
|
+
<header>
|
127
|
+
<h3>Public Class Methods</h3>
|
128
|
+
</header>
|
129
|
+
|
130
|
+
|
131
|
+
<div id="method-c-new" class="method-detail ">
|
132
|
+
|
133
|
+
<div class="method-heading">
|
134
|
+
<span class="method-name">new</span><span
|
135
|
+
class="method-args">(nombre, proteinas, glucidos, lipidos)</span>
|
136
|
+
|
137
|
+
<span class="method-click-advice">click to toggle source</span>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<div class="method-calls-super">
|
148
|
+
Calls superclass method
|
149
|
+
<a href="Alimento.html#method-c-new">Alimento::Alimento.new</a>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<div class="method-source-code" id="new-source">
|
155
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 143</span>
|
156
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">proteinas</span>, <span class="ruby-identifier">glucidos</span>, <span class="ruby-identifier">lipidos</span>)
|
157
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">proteinas</span>, <span class="ruby-identifier">glucidos</span>, <span class="ruby-identifier">lipidos</span>)
|
158
|
+
<span class="ruby-ivar">@grupo</span> = <span class="ruby-string">"Alimentos Grasos"</span>
|
159
|
+
<span class="ruby-keyword">end</span></pre>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
</div>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
</section>
|
171
|
+
|
172
|
+
</section>
|
173
|
+
</main>
|
174
|
+
|
175
|
+
|
176
|
+
<footer id="validator-badges" role="contentinfo">
|
177
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
178
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.2.
|
179
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
180
|
+
</footer>
|
181
|
+
|
@@ -0,0 +1,181 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Alimento::AliRicCar - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script src="../js/jquery.js"></script>
|
14
|
+
<script src="../js/darkfish.js"></script>
|
15
|
+
|
16
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
17
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<body id="top" role="document" class="class">
|
22
|
+
<nav role="navigation">
|
23
|
+
<div id="project-navigation">
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
25
|
+
<h2>
|
26
|
+
<a href="../index.html" rel="home">Home</a>
|
27
|
+
</h2>
|
28
|
+
|
29
|
+
<div id="table-of-contents-navigation">
|
30
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
31
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
32
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
38
|
+
<div id="search-field-wrapper">
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
46
|
+
aria-busy="false" aria-expanded="false"
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
48
|
+
</form>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<div id="class-metadata">
|
56
|
+
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
58
|
+
<h3>Parent</h3>
|
59
|
+
|
60
|
+
|
61
|
+
<p class="link"><a href="Alimento.html">Alimento::Alimento</a>
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<div id="method-list-section" class="nav-section">
|
69
|
+
<h3>Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list" role="directory">
|
72
|
+
|
73
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
<main role="main" aria-labelledby="class-Alimento::AliRicCar">
|
82
|
+
<h1 id="class-Alimento::AliRicCar" class="class">
|
83
|
+
class Alimento::AliRicCar
|
84
|
+
</h1>
|
85
|
+
|
86
|
+
<section class="description">
|
87
|
+
|
88
|
+
</section>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<section class="attribute-method-details" class="method-section">
|
102
|
+
<header>
|
103
|
+
<h3>Attributes</h3>
|
104
|
+
</header>
|
105
|
+
|
106
|
+
|
107
|
+
<div id="attribute-i-grupo" class="method-detail">
|
108
|
+
<div class="method-heading attribute-method-heading">
|
109
|
+
<span class="method-name">grupo</span><span
|
110
|
+
class="attribute-access-type">[R]</span>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<div class="method-description">
|
114
|
+
|
115
|
+
<p>Esta clase permite representar alimentos dentro del grupo “Alimentos Ricos
|
116
|
+
en Carbohidratos”. Hereda de la clase alimento.</p>
|
117
|
+
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
</section>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
126
|
+
<header>
|
127
|
+
<h3>Public Class Methods</h3>
|
128
|
+
</header>
|
129
|
+
|
130
|
+
|
131
|
+
<div id="method-c-new" class="method-detail ">
|
132
|
+
|
133
|
+
<div class="method-heading">
|
134
|
+
<span class="method-name">new</span><span
|
135
|
+
class="method-args">(nombre, proteinas, glucidos, lipidos)</span>
|
136
|
+
|
137
|
+
<span class="method-click-advice">click to toggle source</span>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<div class="method-calls-super">
|
148
|
+
Calls superclass method
|
149
|
+
<a href="Alimento.html#method-c-new">Alimento::Alimento.new</a>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<div class="method-source-code" id="new-source">
|
155
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 159</span>
|
156
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">proteinas</span>, <span class="ruby-identifier">glucidos</span>, <span class="ruby-identifier">lipidos</span>)
|
157
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">proteinas</span>, <span class="ruby-identifier">glucidos</span>, <span class="ruby-identifier">lipidos</span>)
|
158
|
+
<span class="ruby-ivar">@grupo</span> = <span class="ruby-string">"Alimentos Ricos en Carbohidratos"</span>
|
159
|
+
<span class="ruby-keyword">end</span></pre>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
</div>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
</section>
|
171
|
+
|
172
|
+
</section>
|
173
|
+
</main>
|
174
|
+
|
175
|
+
|
176
|
+
<footer id="validator-badges" role="contentinfo">
|
177
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
178
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.2.
|
179
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
180
|
+
</footer>
|
181
|
+
|
@@ -0,0 +1,474 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Alimento::Alimento - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script src="../js/jquery.js"></script>
|
14
|
+
<script src="../js/darkfish.js"></script>
|
15
|
+
|
16
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
17
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<body id="top" role="document" class="class">
|
22
|
+
<nav role="navigation">
|
23
|
+
<div id="project-navigation">
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
25
|
+
<h2>
|
26
|
+
<a href="../index.html" rel="home">Home</a>
|
27
|
+
</h2>
|
28
|
+
|
29
|
+
<div id="table-of-contents-navigation">
|
30
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
31
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
32
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
38
|
+
<div id="search-field-wrapper">
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
46
|
+
aria-busy="false" aria-expanded="false"
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
48
|
+
</form>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<div id="class-metadata">
|
56
|
+
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
58
|
+
<h3>Parent</h3>
|
59
|
+
|
60
|
+
|
61
|
+
<p class="link">Object
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div id="includes-section" class="nav-section">
|
66
|
+
<h3>Included Modules</h3>
|
67
|
+
|
68
|
+
<ul class="link-list">
|
69
|
+
|
70
|
+
|
71
|
+
<li><span class="include">Comparable</span>
|
72
|
+
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
<!-- Method Quickref -->
|
79
|
+
<div id="method-list-section" class="nav-section">
|
80
|
+
<h3>Methods</h3>
|
81
|
+
|
82
|
+
<ul class="link-list" role="directory">
|
83
|
+
|
84
|
+
<li ><a href="#method-c-new">::new</a>
|
85
|
+
|
86
|
+
<li ><a href="#method-i-3C-3D-3E">#<=></a>
|
87
|
+
|
88
|
+
<li ><a href="#method-i-3D-3D">#==</a>
|
89
|
+
|
90
|
+
<li ><a href="#method-i-aibc">#aibc</a>
|
91
|
+
|
92
|
+
<li ><a href="#method-i-ind_glu">#ind_glu</a>
|
93
|
+
|
94
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
95
|
+
|
96
|
+
<li ><a href="#method-i-val_energ">#val_energ</a>
|
97
|
+
|
98
|
+
</ul>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
</nav>
|
103
|
+
|
104
|
+
<main role="main" aria-labelledby="class-Alimento::Alimento">
|
105
|
+
<h1 id="class-Alimento::Alimento" class="class">
|
106
|
+
class Alimento::Alimento
|
107
|
+
</h1>
|
108
|
+
|
109
|
+
<section class="description">
|
110
|
+
|
111
|
+
<p>Esta clase permite representar un alimento. Se ha incluido el mixin
|
112
|
+
Comparable.</p>
|
113
|
+
|
114
|
+
</section>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
<section class="attribute-method-details" class="method-section">
|
128
|
+
<header>
|
129
|
+
<h3>Attributes</h3>
|
130
|
+
</header>
|
131
|
+
|
132
|
+
|
133
|
+
<div id="attribute-i-glucidos" class="method-detail">
|
134
|
+
<div class="method-heading attribute-method-heading">
|
135
|
+
<span class="method-name">glucidos</span><span
|
136
|
+
class="attribute-access-type">[R]</span>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<div class="method-description">
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<div id="attribute-i-lipidos" class="method-detail">
|
147
|
+
<div class="method-heading attribute-method-heading">
|
148
|
+
<span class="method-name">lipidos</span><span
|
149
|
+
class="attribute-access-type">[R]</span>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div class="method-description">
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<div id="attribute-i-nombre" class="method-detail">
|
160
|
+
<div class="method-heading attribute-method-heading">
|
161
|
+
<span class="method-name">nombre</span><span
|
162
|
+
class="attribute-access-type">[R]</span>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="method-description">
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
</div>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
<div id="attribute-i-proteinas" class="method-detail">
|
173
|
+
<div class="method-heading attribute-method-heading">
|
174
|
+
<span class="method-name">proteinas</span><span
|
175
|
+
class="attribute-access-type">[R]</span>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div class="method-description">
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
</section>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
190
|
+
<header>
|
191
|
+
<h3>Public Class Methods</h3>
|
192
|
+
</header>
|
193
|
+
|
194
|
+
|
195
|
+
<div id="method-c-new" class="method-detail ">
|
196
|
+
|
197
|
+
<div class="method-heading">
|
198
|
+
<span class="method-name">new</span><span
|
199
|
+
class="method-args">(nombre, proteinas, glucidos, lipidos)</span>
|
200
|
+
|
201
|
+
<span class="method-click-advice">click to toggle source</span>
|
202
|
+
|
203
|
+
</div>
|
204
|
+
|
205
|
+
|
206
|
+
<div class="method-description">
|
207
|
+
|
208
|
+
<p>Se guarda el nombre y valor para proteínas, glúcidos y lípidos.</p>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<div class="method-source-code" id="new-source">
|
214
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 23</span>
|
215
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">proteinas</span>, <span class="ruby-identifier">glucidos</span>, <span class="ruby-identifier">lipidos</span>)
|
216
|
+
<span class="ruby-ivar">@nombre</span>, <span class="ruby-ivar">@proteinas</span>, <span class="ruby-ivar">@glucidos</span>, <span class="ruby-ivar">@lipidos</span> = <span class="ruby-identifier">nombre</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">proteinas</span>, <span class="ruby-identifier">glucidos</span>, <span class="ruby-identifier">lipidos</span>
|
217
|
+
<span class="ruby-keyword">end</span></pre>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
</div>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
</section>
|
229
|
+
|
230
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
231
|
+
<header>
|
232
|
+
<h3>Public Instance Methods</h3>
|
233
|
+
</header>
|
234
|
+
|
235
|
+
|
236
|
+
<div id="method-i-3C-3D-3E" class="method-detail ">
|
237
|
+
|
238
|
+
<div class="method-heading">
|
239
|
+
<span class="method-name"><=></span><span
|
240
|
+
class="method-args">(other)</span>
|
241
|
+
|
242
|
+
<span class="method-click-advice">click to toggle source</span>
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
<div class="method-description">
|
248
|
+
|
249
|
+
<p>Se define para incluir el mixin comparable Se usa como valor para la
|
250
|
+
comparación el valor energético.</p>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
<div class="method-source-code" id="3C-3D-3E-source">
|
256
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 71</span>
|
257
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator"><=></span>(<span class="ruby-identifier">other</span>)
|
258
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_a?</span><span class="ruby-constant">Alimento</span>
|
259
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">val_energ</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">val_energ</span>
|
260
|
+
<span class="ruby-keyword">end</span></pre>
|
261
|
+
</div>
|
262
|
+
|
263
|
+
</div>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
</div>
|
269
|
+
|
270
|
+
|
271
|
+
<div id="method-i-3D-3D" class="method-detail ">
|
272
|
+
|
273
|
+
<div class="method-heading">
|
274
|
+
<span class="method-name">==</span><span
|
275
|
+
class="method-args">(other)</span>
|
276
|
+
|
277
|
+
<span class="method-click-advice">click to toggle source</span>
|
278
|
+
|
279
|
+
</div>
|
280
|
+
|
281
|
+
|
282
|
+
<div class="method-description">
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
<div class="method-source-code" id="3D-3D-source">
|
290
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 76</span>
|
291
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
|
292
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_a?</span><span class="ruby-constant">Alimento</span>
|
293
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">nombre</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">nombre</span> <span class="ruby-operator">&&</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">proteinas</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">proteinas</span> <span class="ruby-operator">&&</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">glucidos</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">glucidos</span> <span class="ruby-operator">&&</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">lipidos</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">lipidos</span>
|
294
|
+
<span class="ruby-keyword">else</span>
|
295
|
+
<span class="ruby-keyword">false</span>
|
296
|
+
<span class="ruby-keyword">end</span>
|
297
|
+
<span class="ruby-keyword">end</span></pre>
|
298
|
+
</div>
|
299
|
+
|
300
|
+
</div>
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
</div>
|
306
|
+
|
307
|
+
|
308
|
+
<div id="method-i-aibc" class="method-detail ">
|
309
|
+
|
310
|
+
<div class="method-heading">
|
311
|
+
<span class="method-name">aibc</span><span
|
312
|
+
class="method-args">(array)</span>
|
313
|
+
|
314
|
+
<span class="method-click-advice">click to toggle source</span>
|
315
|
+
|
316
|
+
</div>
|
317
|
+
|
318
|
+
|
319
|
+
<div class="method-description">
|
320
|
+
|
321
|
+
<p>Calcula el área incremental bajo de la curva del array de datos que recibe.</p>
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
<div class="method-source-code" id="aibc-source">
|
327
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 33</span>
|
328
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">aibc</span>(<span class="ruby-identifier">array</span>)
|
329
|
+
<span class="ruby-identifier">bfr</span> = <span class="ruby-identifier">array</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span><span class="ruby-operator">-</span><span class="ruby-identifier">array</span>[<span class="ruby-value">0</span>]}
|
330
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">array</span>.<span class="ruby-identifier">drop</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">collect!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">x</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">array</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword">then</span> <span class="ruby-value">0.0</span> <span class="ruby-keyword">else</span> <span class="ruby-identifier">x</span><span class="ruby-operator">-</span><span class="ruby-identifier">array</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword">end</span>}.<span class="ruby-identifier">zip</span>(<span class="ruby-identifier">bfr</span>).<span class="ruby-identifier">collect!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">x!</span>=<span class="ruby-value">0.0</span> <span class="ruby-keyword">then</span> (<span class="ruby-identifier">x</span><span class="ruby-operator">+</span><span class="ruby-identifier">y</span>)<span class="ruby-operator">*</span><span class="ruby-value">2.5</span> <span class="ruby-keyword">else</span> <span class="ruby-value">0.0</span> <span class="ruby-keyword">end</span>}
|
331
|
+
<span class="ruby-identifier">res</span>.<span class="ruby-identifier">reduce</span>(<span class="ruby-value">:+</span>)
|
332
|
+
<span class="ruby-keyword">end</span></pre>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
</div>
|
341
|
+
|
342
|
+
|
343
|
+
<div id="method-i-ind_glu" class="method-detail ">
|
344
|
+
|
345
|
+
<div class="method-heading">
|
346
|
+
<span class="method-name">ind_glu</span><span
|
347
|
+
class="method-args">(filename)</span>
|
348
|
+
|
349
|
+
<span class="method-click-advice">click to toggle source</span>
|
350
|
+
|
351
|
+
</div>
|
352
|
+
|
353
|
+
|
354
|
+
<div class="method-description">
|
355
|
+
|
356
|
+
<p>Calcula el índice glucémico del alimento cuyos datos haya en el fichero que
|
357
|
+
recibe.</p>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
<div class="method-source-code" id="ind_glu-source">
|
363
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 40</span>
|
364
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">ind_glu</span>(<span class="ruby-identifier">filename</span>)
|
365
|
+
<span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filename</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-string">"r"</span>)
|
366
|
+
<span class="ruby-identifier">number</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">gets</span>
|
367
|
+
|
368
|
+
<span class="ruby-identifier">inds</span> = []
|
369
|
+
<span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">times</span> {
|
370
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">gets</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">" "</span>).<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_f</span>}
|
371
|
+
<span class="ruby-identifier">inds</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">aux</span>
|
372
|
+
}
|
373
|
+
|
374
|
+
<span class="ruby-identifier">glucs</span> = []
|
375
|
+
<span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">times</span> {
|
376
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">gets</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">" "</span>).<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_f</span>}
|
377
|
+
<span class="ruby-identifier">glucs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">aux</span>
|
378
|
+
}
|
379
|
+
|
380
|
+
|
381
|
+
<span class="ruby-identifier">inds</span>.<span class="ruby-identifier">collect!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">aibc</span>(<span class="ruby-identifier">x</span>)}
|
382
|
+
<span class="ruby-identifier">glucs</span>.<span class="ruby-identifier">collect!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">aibc</span>(<span class="ruby-identifier">x</span>)}
|
383
|
+
|
384
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">inds</span>.<span class="ruby-identifier">zip</span>(<span class="ruby-identifier">glucs</span>).<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span><span class="ruby-operator">/</span><span class="ruby-identifier">y</span><span class="ruby-operator">*</span><span class="ruby-value">100</span>}.<span class="ruby-identifier">reduce</span>(<span class="ruby-value">:+</span>)<span class="ruby-operator">/</span><span class="ruby-value">2</span>
|
385
|
+
|
386
|
+
<span class="ruby-keyword">end</span></pre>
|
387
|
+
</div>
|
388
|
+
|
389
|
+
</div>
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
</div>
|
395
|
+
|
396
|
+
|
397
|
+
<div id="method-i-to_s" class="method-detail ">
|
398
|
+
|
399
|
+
<div class="method-heading">
|
400
|
+
<span class="method-name">to_s</span><span
|
401
|
+
class="method-args">()</span>
|
402
|
+
|
403
|
+
<span class="method-click-advice">click to toggle source</span>
|
404
|
+
|
405
|
+
</div>
|
406
|
+
|
407
|
+
|
408
|
+
<div class="method-description">
|
409
|
+
|
410
|
+
<p>Muestra la información del objeto formateada. Lo convierte a string.</p>
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
<div class="method-source-code" id="to_s-source">
|
416
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 65</span>
|
417
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
418
|
+
<span class="ruby-string">"%-15s"</span> <span class="ruby-operator">%</span> [<span class="ruby-node">"#{@nombre.capitalize}: "</span>] <span class="ruby-operator">+</span> <span class="ruby-node">"#{@proteinas} #{@glucidos} #{@lipidos}"</span> <span class="ruby-operator">+</span> <span class="ruby-node">" grupo: #{@grupo}"</span>
|
419
|
+
<span class="ruby-keyword">end</span></pre>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
</div>
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
</div>
|
428
|
+
|
429
|
+
|
430
|
+
<div id="method-i-val_energ" class="method-detail ">
|
431
|
+
|
432
|
+
<div class="method-heading">
|
433
|
+
<span class="method-name">val_energ</span><span
|
434
|
+
class="method-args">()</span>
|
435
|
+
|
436
|
+
<span class="method-click-advice">click to toggle source</span>
|
437
|
+
|
438
|
+
</div>
|
439
|
+
|
440
|
+
|
441
|
+
<div class="method-description">
|
442
|
+
|
443
|
+
<p>Calcula el valor enérgetico del alimento.</p>
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
<div class="method-source-code" id="val_energ-source">
|
449
|
+
<pre><span class="ruby-comment"># File lib/alimento/fuente.rb, line 28</span>
|
450
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">val_energ</span>
|
451
|
+
<span class="ruby-ivar">@proteinas</span><span class="ruby-operator">*</span><span class="ruby-value">4</span><span class="ruby-operator">+</span><span class="ruby-ivar">@glucidos</span><span class="ruby-operator">*</span><span class="ruby-value">4</span><span class="ruby-operator">+</span><span class="ruby-ivar">@lipidos</span><span class="ruby-operator">*</span><span class="ruby-value">9</span>
|
452
|
+
<span class="ruby-keyword">end</span></pre>
|
453
|
+
</div>
|
454
|
+
|
455
|
+
</div>
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
</div>
|
461
|
+
|
462
|
+
|
463
|
+
</section>
|
464
|
+
|
465
|
+
</section>
|
466
|
+
</main>
|
467
|
+
|
468
|
+
|
469
|
+
<footer id="validator-badges" role="contentinfo">
|
470
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
471
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.2.
|
472
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
473
|
+
</footer>
|
474
|
+
|