alimentos_diego_algomas 0.1.3
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 +12 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +97 -0
- data/Guardfile +83 -0
- data/README.md +57 -0
- data/Rakefile +6 -0
- data/alimentos.gemspec +38 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Alimentos.html +115 -0
- data/docs/Alimentos/Alimentos.html +376 -0
- data/docs/Alimentos/Error.html +106 -0
- data/docs/Gemfile.html +99 -0
- data/docs/Gemfile_lock.html +180 -0
- data/docs/Guardfile.html +166 -0
- data/docs/List.html +120 -0
- data/docs/List/Error.html +106 -0
- data/docs/List/List.html +495 -0
- data/docs/Menu.html +115 -0
- data/docs/Menu/Error.html +106 -0
- data/docs/Menu/Menu.html +512 -0
- data/docs/Object.html +199 -0
- data/docs/Plato.html +115 -0
- data/docs/Plato/Error.html +106 -0
- data/docs/Plato/Plato.html +478 -0
- data/docs/Plato/PlatoAmbiental.html +374 -0
- data/docs/README_md.html +155 -0
- data/docs/Rakefile.html +101 -0
- data/docs/bin/setup.html +101 -0
- data/docs/created.rid +17 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +619 -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 +132 -0
- data/docs/js/darkfish.js +84 -0
- data/docs/js/navigation.js +105 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +110 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +345 -0
- data/lib/alimentos.rb +29 -0
- data/lib/alimentos/alimentos.rb +36 -0
- data/lib/alimentos/dsl.rb +123 -0
- data/lib/alimentos/dslmenu.rb +60 -0
- data/lib/alimentos/list.rb +104 -0
- data/lib/alimentos/menu.rb +62 -0
- data/lib/alimentos/plato.rb +93 -0
- data/lib/alimentos/platoAmbiental.rb +64 -0
- data/lib/alimentos/version.rb +15 -0
- metadata +243 -0
data/docs/Object.html
ADDED
@@ -0,0 +1,199 @@
|
|
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/navigation.js" defer></script>
|
15
|
+
<script src="./js/search.js" defer></script>
|
16
|
+
<script src="./js/search_index.js" defer></script>
|
17
|
+
<script src="./js/searcher.js" defer></script>
|
18
|
+
<script src="./js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
<body id="top" role="document" class="class">
|
27
|
+
<nav role="navigation">
|
28
|
+
<div id="project-navigation">
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
+
<h2>
|
31
|
+
<a href="./index.html" rel="home">Home</a>
|
32
|
+
</h2>
|
33
|
+
|
34
|
+
<div id="table-of-contents-navigation">
|
35
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
36
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
37
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
|
+
<div id="search-field-wrapper">
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
51
|
+
aria-busy="false" aria-expanded="false"
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
+
</form>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
<div id="parent-class-section" class="nav-section">
|
63
|
+
<h3>Parent</h3>
|
64
|
+
|
65
|
+
|
66
|
+
<p class="link">BasicObject
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
<!-- Method Quickref -->
|
73
|
+
<div id="method-list-section" class="nav-section">
|
74
|
+
<h3>Methods</h3>
|
75
|
+
|
76
|
+
<ul class="link-list" role="directory">
|
77
|
+
|
78
|
+
<li ><a href="#method-i-huella_nutricional">#huella_nutricional</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-multiplicadorAmbiental">#multiplicadorAmbiental</a>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
</nav>
|
87
|
+
|
88
|
+
<main role="main" aria-labelledby="class-Object">
|
89
|
+
<h1 id="class-Object" class="class">
|
90
|
+
class Object
|
91
|
+
</h1>
|
92
|
+
|
93
|
+
<section class="description">
|
94
|
+
|
95
|
+
</section>
|
96
|
+
|
97
|
+
|
98
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
109
|
+
<header>
|
110
|
+
<h3>Public Instance Methods</h3>
|
111
|
+
</header>
|
112
|
+
|
113
|
+
|
114
|
+
<div id="method-i-huella_nutricional" class="method-detail ">
|
115
|
+
|
116
|
+
<div class="method-heading">
|
117
|
+
<span class="method-name">huella_nutricional</span><span
|
118
|
+
class="method-args">(menu)</span>
|
119
|
+
|
120
|
+
<span class="method-click-advice">click to toggle source</span>
|
121
|
+
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
<div class="method-description">
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<div class="method-source-code" id="huella_nutricional-source">
|
133
|
+
<pre><span class="ruby-comment"># File spec/alimentos_spec.rb, line 581</span>
|
134
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">huella_nutricional</span>(<span class="ruby-identifier">menu</span>)
|
135
|
+
<span class="ruby-identifier">hmenu</span>=<span class="ruby-value">0</span>
|
136
|
+
<span class="ruby-identifier">menu</span>.<span class="ruby-identifier">collect</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
|
137
|
+
<span class="ruby-identifier">hmenu</span><span class="ruby-operator">+=</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">huella</span>()
|
138
|
+
}
|
139
|
+
<span class="ruby-identifier">hmenu</span>= <span class="ruby-identifier">hmenu</span><span class="ruby-operator">/</span> <span class="ruby-identifier">menu</span>.<span class="ruby-identifier">length</span>
|
140
|
+
<span class="ruby-identifier">hmenu</span>
|
141
|
+
<span class="ruby-keyword">end</span></pre>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
<div id="method-i-multiplicadorAmbiental" class="method-detail ">
|
153
|
+
|
154
|
+
<div class="method-heading">
|
155
|
+
<span class="method-name">multiplicadorAmbiental</span><span
|
156
|
+
class="method-args">(menu,precios)</span>
|
157
|
+
|
158
|
+
<span class="method-click-advice">click to toggle source</span>
|
159
|
+
|
160
|
+
</div>
|
161
|
+
|
162
|
+
|
163
|
+
<div class="method-description">
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
<div class="method-source-code" id="multiplicadorAmbiental-source">
|
171
|
+
<pre><span class="ruby-comment"># File spec/alimentos_spec.rb, line 591</span>
|
172
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">multiplicadorAmbiental</span>(<span class="ruby-identifier">menu</span>,<span class="ruby-identifier">precios</span>)
|
173
|
+
<span class="ruby-identifier">huella</span>=<span class="ruby-identifier">menu</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">huella</span>()}
|
174
|
+
<span class="ruby-identifier">huella</span> = <span class="ruby-identifier">huella</span>.<span class="ruby-identifier">sum</span><span class="ruby-operator">/</span><span class="ruby-identifier">menu</span>.<span class="ruby-identifier">length</span>
|
175
|
+
<span class="ruby-identifier">precio</span> = <span class="ruby-identifier">huella</span><span class="ruby-operator">*</span><span class="ruby-identifier">precios</span>.<span class="ruby-identifier">sum</span>
|
176
|
+
<span class="ruby-keyword">end</span></pre>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</div>
|
185
|
+
|
186
|
+
|
187
|
+
</section>
|
188
|
+
|
189
|
+
</section>
|
190
|
+
|
191
|
+
</main>
|
192
|
+
|
193
|
+
|
194
|
+
<footer id="validator-badges" role="contentinfo">
|
195
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
196
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
197
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
198
|
+
</footer>
|
199
|
+
|
data/docs/Plato.html
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module 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/navigation.js" defer></script>
|
15
|
+
<script src="./js/search.js" defer></script>
|
16
|
+
<script src="./js/search_index.js" defer></script>
|
17
|
+
<script src="./js/searcher.js" defer></script>
|
18
|
+
<script src="./js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
<body id="top" role="document" class="module">
|
27
|
+
<nav role="navigation">
|
28
|
+
<div id="project-navigation">
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
+
<h2>
|
31
|
+
<a href="./index.html" rel="home">Home</a>
|
32
|
+
</h2>
|
33
|
+
|
34
|
+
<div id="table-of-contents-navigation">
|
35
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
36
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
37
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
|
+
<div id="search-field-wrapper">
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
51
|
+
aria-busy="false" aria-expanded="false"
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
+
</form>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</div>
|
67
|
+
</nav>
|
68
|
+
|
69
|
+
<main role="main" aria-labelledby="module-Plato">
|
70
|
+
<h1 id="module-Plato" class="module">
|
71
|
+
module Plato
|
72
|
+
</h1>
|
73
|
+
|
74
|
+
<section class="description">
|
75
|
+
|
76
|
+
<p>Modulo donde se encuentran la clase plato y plato ambiental</p>
|
77
|
+
|
78
|
+
</section>
|
79
|
+
|
80
|
+
|
81
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
<section class="constants-list">
|
88
|
+
<header>
|
89
|
+
<h3>Constants</h3>
|
90
|
+
</header>
|
91
|
+
<dl>
|
92
|
+
|
93
|
+
<dt id="VERSION">VERSION
|
94
|
+
|
95
|
+
<dd>
|
96
|
+
|
97
|
+
|
98
|
+
</dl>
|
99
|
+
</section>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
</section>
|
106
|
+
|
107
|
+
</main>
|
108
|
+
|
109
|
+
|
110
|
+
<footer id="validator-badges" role="contentinfo">
|
111
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
112
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
113
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
114
|
+
</footer>
|
115
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Plato::Error - 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/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
<body id="top" role="document" class="class">
|
27
|
+
<nav role="navigation">
|
28
|
+
<div id="project-navigation">
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
+
<h2>
|
31
|
+
<a href="../index.html" rel="home">Home</a>
|
32
|
+
</h2>
|
33
|
+
|
34
|
+
<div id="table-of-contents-navigation">
|
35
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
36
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
37
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
|
+
<div id="search-field-wrapper">
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
51
|
+
aria-busy="false" aria-expanded="false"
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
+
</form>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
<div id="parent-class-section" class="nav-section">
|
63
|
+
<h3>Parent</h3>
|
64
|
+
|
65
|
+
|
66
|
+
<p class="link">StandardError
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
</nav>
|
75
|
+
|
76
|
+
<main role="main" aria-labelledby="class-Plato::Error">
|
77
|
+
<h1 id="class-Plato::Error" class="class">
|
78
|
+
class Plato::Error
|
79
|
+
</h1>
|
80
|
+
|
81
|
+
<section class="description">
|
82
|
+
|
83
|
+
</section>
|
84
|
+
|
85
|
+
|
86
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
</section>
|
97
|
+
|
98
|
+
</main>
|
99
|
+
|
100
|
+
|
101
|
+
<footer id="validator-badges" role="contentinfo">
|
102
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
103
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
104
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
105
|
+
</footer>
|
106
|
+
|
@@ -0,0 +1,478 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Plato::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/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
<body id="top" role="document" class="class">
|
27
|
+
<nav role="navigation">
|
28
|
+
<div id="project-navigation">
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
+
<h2>
|
31
|
+
<a href="../index.html" rel="home">Home</a>
|
32
|
+
</h2>
|
33
|
+
|
34
|
+
<div id="table-of-contents-navigation">
|
35
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
36
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
37
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
|
+
<div id="search-field-wrapper">
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
51
|
+
aria-busy="false" aria-expanded="false"
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
+
</form>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
<div id="parent-class-section" class="nav-section">
|
63
|
+
<h3>Parent</h3>
|
64
|
+
|
65
|
+
|
66
|
+
<p class="link"><a href="../Object.html">Object</a>
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<div id="includes-section" class="nav-section">
|
71
|
+
<h3>Included Modules</h3>
|
72
|
+
|
73
|
+
<ul class="link-list">
|
74
|
+
|
75
|
+
|
76
|
+
<li><a class="include" href="../List.html">List</a>
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<li><span class="include">Comparable</span>
|
81
|
+
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
<!-- Method Quickref -->
|
88
|
+
<div id="method-list-section" class="nav-section">
|
89
|
+
<h3>Methods</h3>
|
90
|
+
|
91
|
+
<ul class="link-list" role="directory">
|
92
|
+
|
93
|
+
<li ><a href="#method-c-new">::new</a>
|
94
|
+
|
95
|
+
<li ><a href="#method-i-3C-3D-3E">#<=></a>
|
96
|
+
|
97
|
+
<li ><a href="#method-i-calculoCalorico">#calculoCalorico</a>
|
98
|
+
|
99
|
+
<li ><a href="#method-i-porcarbohidratos">#porcarbohidratos</a>
|
100
|
+
|
101
|
+
<li ><a href="#method-i-porlipidos">#porlipidos</a>
|
102
|
+
|
103
|
+
<li ><a href="#method-i-porproteinas">#porproteinas</a>
|
104
|
+
|
105
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
106
|
+
|
107
|
+
</ul>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</nav>
|
112
|
+
|
113
|
+
<main role="main" aria-labelledby="class-Plato::Plato">
|
114
|
+
<h1 id="class-Plato::Plato" class="class">
|
115
|
+
class Plato::Plato
|
116
|
+
</h1>
|
117
|
+
|
118
|
+
<section class="description">
|
119
|
+
|
120
|
+
<p>Clase plato donde se encuentran los platos dormados por sus alimentos y sus cantidades</p>
|
121
|
+
|
122
|
+
</section>
|
123
|
+
|
124
|
+
|
125
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<section class="attribute-method-details" class="method-section">
|
134
|
+
<header>
|
135
|
+
<h3>Attributes</h3>
|
136
|
+
</header>
|
137
|
+
|
138
|
+
|
139
|
+
<div id="attribute-i-alimentos" class="method-detail">
|
140
|
+
<div class="method-heading attribute-method-heading">
|
141
|
+
<span class="method-name">alimentos</span><span
|
142
|
+
class="attribute-access-type">[R]</span>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="method-description">
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div id="attribute-i-cantidades" class="method-detail">
|
153
|
+
<div class="method-heading attribute-method-heading">
|
154
|
+
<span class="method-name">cantidades</span><span
|
155
|
+
class="attribute-access-type">[R]</span>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div class="method-description">
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div id="attribute-i-kcal" class="method-detail">
|
166
|
+
<div class="method-heading attribute-method-heading">
|
167
|
+
<span class="method-name">kcal</span><span
|
168
|
+
class="attribute-access-type">[R]</span>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div class="method-description">
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div id="attribute-i-nombre" class="method-detail">
|
179
|
+
<div class="method-heading attribute-method-heading">
|
180
|
+
<span class="method-name">nombre</span><span
|
181
|
+
class="attribute-access-type">[R]</span>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div class="method-description">
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
</section>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
196
|
+
<header>
|
197
|
+
<h3>Public Class Methods</h3>
|
198
|
+
</header>
|
199
|
+
|
200
|
+
|
201
|
+
<div id="method-c-new" class="method-detail ">
|
202
|
+
|
203
|
+
<div class="method-heading">
|
204
|
+
<span class="method-name">new</span><span
|
205
|
+
class="method-args">(nombre,alimentos,cantidades)</span>
|
206
|
+
|
207
|
+
<span class="method-click-advice">click to toggle source</span>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
|
212
|
+
<div class="method-description">
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<div class="method-source-code" id="new-source">
|
220
|
+
<pre><span class="ruby-comment"># File lib/alimentos/plato.rb, line 14</span>
|
221
|
+
<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">cantidades</span>)
|
222
|
+
<span class="ruby-ivar">@nombre</span> = <span class="ruby-identifier">nombre</span>
|
223
|
+
<span class="ruby-ivar">@alimentos</span> = <span class="ruby-constant">List</span>.<span class="ruby-identifier">new</span>()
|
224
|
+
<span class="ruby-ivar">@cantidades</span> = <span class="ruby-constant">List</span>.<span class="ruby-identifier">new</span>()
|
225
|
+
<span class="ruby-ivar">@alimentos</span>.<span class="ruby-identifier">push_array</span>(<span class="ruby-identifier">alimentos</span>)
|
226
|
+
<span class="ruby-ivar">@cantidades</span>.<span class="ruby-identifier">push_array</span>(<span class="ruby-identifier">cantidades</span>)
|
227
|
+
<span class="ruby-ivar">@kcal</span> = <span class="ruby-identifier">calculoCalorico</span>()
|
228
|
+
|
229
|
+
<span class="ruby-keyword">end</span></pre>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
</div>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
</div>
|
238
|
+
|
239
|
+
|
240
|
+
</section>
|
241
|
+
|
242
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
243
|
+
<header>
|
244
|
+
<h3>Public Instance Methods</h3>
|
245
|
+
</header>
|
246
|
+
|
247
|
+
|
248
|
+
<div id="method-i-3C-3D-3E" class="method-detail ">
|
249
|
+
|
250
|
+
<div class="method-heading">
|
251
|
+
<span class="method-name"><=></span><span
|
252
|
+
class="method-args">(other)</span>
|
253
|
+
|
254
|
+
<span class="method-click-advice">click to toggle source</span>
|
255
|
+
|
256
|
+
</div>
|
257
|
+
|
258
|
+
|
259
|
+
<div class="method-description">
|
260
|
+
|
261
|
+
<p>Permite comparar entre distintos platos según las kcal</p>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
<div class="method-source-code" id="3C-3D-3E-source">
|
267
|
+
<pre><span class="ruby-comment"># File lib/alimentos/plato.rb, line 70</span>
|
268
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title"><=></span>(<span class="ruby-identifier">other</span>)
|
269
|
+
<span class="ruby-ivar">@kcal</span><span class="ruby-operator"><=></span><span class="ruby-identifier">other</span>.<span class="ruby-identifier">kcal</span>
|
270
|
+
<span class="ruby-keyword">end</span></pre>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
<div id="method-i-calculoCalorico" class="method-detail ">
|
282
|
+
|
283
|
+
<div class="method-heading">
|
284
|
+
<span class="method-name">calculoCalorico</span><span
|
285
|
+
class="method-args">()</span>
|
286
|
+
|
287
|
+
<span class="method-click-advice">click to toggle source</span>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
|
292
|
+
<div class="method-description">
|
293
|
+
|
294
|
+
<p>Realiza el calculo de las calorias totales del plato</p>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
<div class="method-source-code" id="calculoCalorico-source">
|
300
|
+
<pre><span class="ruby-comment"># File lib/alimentos/plato.rb, line 25</span>
|
301
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">calculoCalorico</span>()
|
302
|
+
<span class="ruby-identifier">calorias</span> = <span class="ruby-ivar">@alimentos</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">calorias</span>()}
|
303
|
+
<span class="ruby-identifier">cantidades</span> = <span class="ruby-ivar">@cantidades</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>}
|
304
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">cantidades</span>.<span class="ruby-identifier">size</span>() <span class="ruby-keyword">do</span>
|
305
|
+
<span class="ruby-identifier">calorias</span>[<span class="ruby-identifier">i</span>]=<span class="ruby-identifier">calorias</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">*</span><span class="ruby-value">0.01</span><span class="ruby-operator">*</span><span class="ruby-identifier">cantidades</span>[<span class="ruby-identifier">i</span>]
|
306
|
+
<span class="ruby-keyword">end</span>
|
307
|
+
<span class="ruby-identifier">calorias</span>.<span class="ruby-identifier">sum</span>
|
308
|
+
<span class="ruby-keyword">end</span></pre>
|
309
|
+
</div>
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
</div>
|
317
|
+
|
318
|
+
|
319
|
+
<div id="method-i-porcarbohidratos" class="method-detail ">
|
320
|
+
|
321
|
+
<div class="method-heading">
|
322
|
+
<span class="method-name">porcarbohidratos</span><span
|
323
|
+
class="method-args">()</span>
|
324
|
+
|
325
|
+
<span class="method-click-advice">click to toggle source</span>
|
326
|
+
|
327
|
+
</div>
|
328
|
+
|
329
|
+
|
330
|
+
<div class="method-description">
|
331
|
+
|
332
|
+
<p>Realiza el calculo del porcentaje de carbohidratos que tiene</p>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
<div class="method-source-code" id="porcarbohidratos-source">
|
338
|
+
<pre><span class="ruby-comment"># File lib/alimentos/plato.rb, line 55</span>
|
339
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">porcarbohidratos</span>()
|
340
|
+
<span class="ruby-identifier">carbohidratos</span> = <span class="ruby-ivar">@alimentos</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">carbohidratos</span> }
|
341
|
+
<span class="ruby-identifier">cantidades</span> = <span class="ruby-ivar">@cantidades</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>}
|
342
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">carbohidratos</span>.<span class="ruby-identifier">size</span>() <span class="ruby-keyword">do</span>
|
343
|
+
<span class="ruby-identifier">carbohidratos</span>[<span class="ruby-identifier">i</span>]=<span class="ruby-identifier">carbohidratos</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">*</span><span class="ruby-identifier">cantidades</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">*</span><span class="ruby-value">0.01</span>
|
344
|
+
<span class="ruby-keyword">end</span>
|
345
|
+
((<span class="ruby-identifier">carbohidratos</span>.<span class="ruby-identifier">sum</span><span class="ruby-operator">*</span><span class="ruby-value">4</span><span class="ruby-operator">/</span><span class="ruby-ivar">@kcal</span>)<span class="ruby-operator">*</span><span class="ruby-value">100</span>).<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
|
346
|
+
<span class="ruby-keyword">end</span></pre>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
</div>
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
</div>
|
355
|
+
|
356
|
+
|
357
|
+
<div id="method-i-porlipidos" class="method-detail ">
|
358
|
+
|
359
|
+
<div class="method-heading">
|
360
|
+
<span class="method-name">porlipidos</span><span
|
361
|
+
class="method-args">()</span>
|
362
|
+
|
363
|
+
<span class="method-click-advice">click to toggle source</span>
|
364
|
+
|
365
|
+
</div>
|
366
|
+
|
367
|
+
|
368
|
+
<div class="method-description">
|
369
|
+
|
370
|
+
<p>Realiza el calculo del porcentaje de lipidos que tiene</p>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
<div class="method-source-code" id="porlipidos-source">
|
376
|
+
<pre><span class="ruby-comment"># File lib/alimentos/plato.rb, line 45</span>
|
377
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">porlipidos</span>()
|
378
|
+
<span class="ruby-identifier">lipidos</span> = <span class="ruby-ivar">@alimentos</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">lipidos</span>}
|
379
|
+
<span class="ruby-identifier">cantidades</span> = <span class="ruby-ivar">@cantidades</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>}
|
380
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">lipidos</span>.<span class="ruby-identifier">size</span>() <span class="ruby-keyword">do</span>
|
381
|
+
<span class="ruby-identifier">lipidos</span>[<span class="ruby-identifier">i</span>]=<span class="ruby-identifier">lipidos</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">*</span><span class="ruby-identifier">cantidades</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">*</span><span class="ruby-value">0.01</span>
|
382
|
+
<span class="ruby-keyword">end</span>
|
383
|
+
((<span class="ruby-identifier">lipidos</span>.<span class="ruby-identifier">sum</span><span class="ruby-operator">*</span><span class="ruby-value">9</span><span class="ruby-operator">/</span><span class="ruby-ivar">@kcal</span>)<span class="ruby-operator">*</span><span class="ruby-value">100</span>).<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
|
384
|
+
<span class="ruby-keyword">end</span></pre>
|
385
|
+
</div>
|
386
|
+
|
387
|
+
</div>
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
</div>
|
393
|
+
|
394
|
+
|
395
|
+
<div id="method-i-porproteinas" class="method-detail ">
|
396
|
+
|
397
|
+
<div class="method-heading">
|
398
|
+
<span class="method-name">porproteinas</span><span
|
399
|
+
class="method-args">()</span>
|
400
|
+
|
401
|
+
<span class="method-click-advice">click to toggle source</span>
|
402
|
+
|
403
|
+
</div>
|
404
|
+
|
405
|
+
|
406
|
+
<div class="method-description">
|
407
|
+
|
408
|
+
<p>Realiza el calculo del porcentaje de proteinas que tiene</p>
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
<div class="method-source-code" id="porproteinas-source">
|
414
|
+
<pre><span class="ruby-comment"># File lib/alimentos/plato.rb, line 35</span>
|
415
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">porproteinas</span>()
|
416
|
+
<span class="ruby-identifier">proteinas</span> = <span class="ruby-ivar">@alimentos</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">proteinas</span>}
|
417
|
+
<span class="ruby-identifier">cantidades</span> = <span class="ruby-ivar">@cantidades</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>}
|
418
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">proteinas</span>.<span class="ruby-identifier">size</span>() <span class="ruby-keyword">do</span>
|
419
|
+
<span class="ruby-identifier">proteinas</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-identifier">proteinas</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">*</span><span class="ruby-identifier">cantidades</span>[<span class="ruby-identifier">i</span>]<span class="ruby-operator">*</span><span class="ruby-value">0.01</span>
|
420
|
+
<span class="ruby-keyword">end</span>
|
421
|
+
((<span class="ruby-identifier">proteinas</span>.<span class="ruby-identifier">sum</span><span class="ruby-operator">*</span><span class="ruby-value">4</span><span class="ruby-operator">/</span><span class="ruby-ivar">@kcal</span>)<span class="ruby-operator">*</span><span class="ruby-value">100</span>).<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
|
422
|
+
<span class="ruby-keyword">end</span></pre>
|
423
|
+
</div>
|
424
|
+
|
425
|
+
</div>
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
</div>
|
431
|
+
|
432
|
+
|
433
|
+
<div id="method-i-to_s" class="method-detail ">
|
434
|
+
|
435
|
+
<div class="method-heading">
|
436
|
+
<span class="method-name">to_s</span><span
|
437
|
+
class="method-args">()</span>
|
438
|
+
|
439
|
+
<span class="method-click-advice">click to toggle source</span>
|
440
|
+
|
441
|
+
</div>
|
442
|
+
|
443
|
+
|
444
|
+
<div class="method-description">
|
445
|
+
|
446
|
+
<p>Serializa el plato</p>
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
<div class="method-source-code" id="to_s-source">
|
452
|
+
<pre><span class="ruby-comment"># File lib/alimentos/plato.rb, line 65</span>
|
453
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>()
|
454
|
+
<span class="ruby-node">"#{nombre}: #{alimentos.collect{|x| x.nombre}.join(",")} #{@kcal}kcal"</span>
|
455
|
+
<span class="ruby-keyword">end</span></pre>
|
456
|
+
</div>
|
457
|
+
|
458
|
+
</div>
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
</div>
|
464
|
+
|
465
|
+
|
466
|
+
</section>
|
467
|
+
|
468
|
+
</section>
|
469
|
+
|
470
|
+
</main>
|
471
|
+
|
472
|
+
|
473
|
+
<footer id="validator-badges" role="contentinfo">
|
474
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
475
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
476
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
477
|
+
</footer>
|
478
|
+
|