feeding 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/Gemfile +4 -0
  6. data/Gemfile.lock +95 -0
  7. data/Guardfile +82 -0
  8. data/README.md +29 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/docs/Alimento.html +699 -0
  13. data/docs/Eficiencia.html +557 -0
  14. data/docs/Feeding.html +110 -0
  15. data/docs/Feeding/Error.html +103 -0
  16. data/docs/Gemfile.html +98 -0
  17. data/docs/Gemfile_lock.html +177 -0
  18. data/docs/Guardfile.html +165 -0
  19. data/docs/Lista.html +763 -0
  20. data/docs/Object.html +117 -0
  21. data/docs/Plato.html +585 -0
  22. data/docs/README_md.html +118 -0
  23. data/docs/Rakefile.html +100 -0
  24. data/docs/bin/setup.html +100 -0
  25. data/docs/created.rid +16 -0
  26. data/docs/css/fonts.css +167 -0
  27. data/docs/css/rdoc.css +590 -0
  28. data/docs/feeding_gemspec.html +132 -0
  29. data/docs/fonts/Lato-Light.ttf +0 -0
  30. data/docs/fonts/Lato-LightItalic.ttf +0 -0
  31. data/docs/fonts/Lato-Regular.ttf +0 -0
  32. data/docs/fonts/Lato-RegularItalic.ttf +0 -0
  33. data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
  34. data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
  35. data/docs/images/add.png +0 -0
  36. data/docs/images/arrow_up.png +0 -0
  37. data/docs/images/brick.png +0 -0
  38. data/docs/images/brick_link.png +0 -0
  39. data/docs/images/bug.png +0 -0
  40. data/docs/images/bullet_black.png +0 -0
  41. data/docs/images/bullet_toggle_minus.png +0 -0
  42. data/docs/images/bullet_toggle_plus.png +0 -0
  43. data/docs/images/date.png +0 -0
  44. data/docs/images/delete.png +0 -0
  45. data/docs/images/find.png +0 -0
  46. data/docs/images/loadingAnimation.gif +0 -0
  47. data/docs/images/macFFBgHack.png +0 -0
  48. data/docs/images/package.png +0 -0
  49. data/docs/images/page_green.png +0 -0
  50. data/docs/images/page_white_text.png +0 -0
  51. data/docs/images/page_white_width.png +0 -0
  52. data/docs/images/plugin.png +0 -0
  53. data/docs/images/ruby.png +0 -0
  54. data/docs/images/tag_blue.png +0 -0
  55. data/docs/images/tag_green.png +0 -0
  56. data/docs/images/transparent.png +0 -0
  57. data/docs/images/wrench.png +0 -0
  58. data/docs/images/wrench_orange.png +0 -0
  59. data/docs/images/zoom.png +0 -0
  60. data/docs/index.html +117 -0
  61. data/docs/js/darkfish.js +161 -0
  62. data/docs/js/jquery.js +4 -0
  63. data/docs/js/navigation.js +141 -0
  64. data/docs/js/navigation.js.gz +0 -0
  65. data/docs/js/search.js +109 -0
  66. data/docs/js/search_index.js +1 -0
  67. data/docs/js/search_index.js.gz +0 -0
  68. data/docs/js/searcher.js +229 -0
  69. data/docs/js/searcher.js.gz +0 -0
  70. data/docs/table_of_contents.html +357 -0
  71. data/feeding.gemspec +37 -0
  72. data/lib/feeding.rb +11 -0
  73. data/lib/feeding/alimento.rb +89 -0
  74. data/lib/feeding/lista.rb +178 -0
  75. data/lib/feeding/menuDSL.rb +37 -0
  76. data/lib/feeding/plato.rb +203 -0
  77. data/lib/feeding/platoDSL.rb +32 -0
  78. data/lib/feeding/version.rb +3 -0
  79. metadata +222 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a7634e59dc86e5e785921dc5e43e399e78b48137f9aeacb6d747911203df1c51
4
+ data.tar.gz: 9f06f2d55282d9a03e2429eaaef3409310009cb7169d643b43b4ceeaf6890e9c
5
+ SHA512:
6
+ metadata.gz: 24228603c7ba1af6d5ba84e78ad60dbd0cf37b20fb0f21f453778fdabb3db1f827bb1f7b4239175aecae4d0655322f0da6dce45376e016e946277a27266fab25
7
+ data.tar.gz: 4d68dc1dfe806f657e04622eef627b0d1f7895614eada7012c709de4fde685aa66131a469b1aed518206dc5b457fad4b2ac25960fade7e60df5a53f97f9bd2dd
@@ -0,0 +1,12 @@
1
+ *.*~
2
+ /.bundle/
3
+ /.yardoc
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.3
7
+ before_install: gem install bundler -v 2.0.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in feeding.gemspec
4
+ gemspec
@@ -0,0 +1,95 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ feeding (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ coderay (1.1.2)
10
+ coveralls (0.8.23)
11
+ json (>= 1.8, < 3)
12
+ simplecov (~> 0.16.1)
13
+ term-ansicolor (~> 1.3)
14
+ thor (>= 0.19.4, < 2.0)
15
+ tins (~> 1.6)
16
+ diff-lcs (1.3)
17
+ docile (1.3.2)
18
+ ffi (1.11.2)
19
+ formatador (0.2.5)
20
+ guard (2.16.1)
21
+ formatador (>= 0.2.4)
22
+ listen (>= 2.7, < 4.0)
23
+ lumberjack (>= 1.0.12, < 2.0)
24
+ nenv (~> 0.1)
25
+ notiffany (~> 0.0)
26
+ pry (>= 0.9.12)
27
+ shellany (~> 0.0)
28
+ thor (>= 0.18.1)
29
+ guard-bundler (2.2.1)
30
+ bundler (>= 1.3.0, < 3)
31
+ guard (~> 2.2)
32
+ guard-compat (~> 1.1)
33
+ guard-compat (1.2.1)
34
+ guard-rspec (4.7.3)
35
+ guard (~> 2.1)
36
+ guard-compat (~> 1.1)
37
+ rspec (>= 2.99.0, < 4.0)
38
+ json (2.3.0)
39
+ listen (3.2.0)
40
+ rb-fsevent (~> 0.10, >= 0.10.3)
41
+ rb-inotify (~> 0.9, >= 0.9.10)
42
+ lumberjack (1.0.13)
43
+ method_source (0.9.2)
44
+ nenv (0.3.0)
45
+ notiffany (0.1.3)
46
+ nenv (~> 0.1)
47
+ shellany (~> 0.0)
48
+ pry (0.12.2)
49
+ coderay (~> 1.1.0)
50
+ method_source (~> 0.9.0)
51
+ rake (10.5.0)
52
+ rb-fsevent (0.10.3)
53
+ rb-inotify (0.10.0)
54
+ ffi (~> 1.0)
55
+ rspec (3.9.0)
56
+ rspec-core (~> 3.9.0)
57
+ rspec-expectations (~> 3.9.0)
58
+ rspec-mocks (~> 3.9.0)
59
+ rspec-core (3.9.0)
60
+ rspec-support (~> 3.9.0)
61
+ rspec-expectations (3.9.0)
62
+ diff-lcs (>= 1.2.0, < 2.0)
63
+ rspec-support (~> 3.9.0)
64
+ rspec-mocks (3.9.0)
65
+ diff-lcs (>= 1.2.0, < 2.0)
66
+ rspec-support (~> 3.9.0)
67
+ rspec-support (3.9.0)
68
+ shellany (0.0.1)
69
+ simplecov (0.16.1)
70
+ docile (~> 1.1)
71
+ json (>= 1.8, < 3)
72
+ simplecov-html (~> 0.10.0)
73
+ simplecov-html (0.10.2)
74
+ sync (0.5.0)
75
+ term-ansicolor (1.7.1)
76
+ tins (~> 1.0)
77
+ thor (0.20.3)
78
+ tins (1.23.0)
79
+ sync
80
+
81
+ PLATFORMS
82
+ ruby
83
+
84
+ DEPENDENCIES
85
+ bundler (~> 2.0)
86
+ coveralls
87
+ feeding!
88
+ guard
89
+ guard-bundler
90
+ guard-rspec
91
+ rake (~> 10.0)
92
+ rspec (~> 3.0)
93
+
94
+ BUNDLED WITH
95
+ 2.0.2
@@ -0,0 +1,82 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ guard :bundler do
19
+ require 'guard/bundler'
20
+ require 'guard/bundler/verify'
21
+ helper = Guard::Bundler::Verify.new
22
+
23
+ files = ['Gemfile']
24
+ files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
25
+
26
+ # Assume files are symlinked from somewhere
27
+ files.each { |file| watch(helper.real_path(file)) }
28
+ end
29
+
30
+ # Note: The cmd option is now required due to the increasing number of ways
31
+ # rspec may be run, below are examples of the most common uses.
32
+ # * bundler: 'bundle exec rspec'
33
+ # * bundler binstubs: 'bin/rspec'
34
+ # * spring: 'bin/rspec' (This will use spring if running and you have
35
+ # installed the spring binstubs per the docs)
36
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
37
+ # * 'just' rspec: 'rspec'
38
+
39
+ guard :rspec, cmd: "bundle exec rspec" do
40
+ require "guard/rspec/dsl"
41
+ dsl = Guard::RSpec::Dsl.new(self)
42
+
43
+ # Feel free to open issues for suggestions and improvements
44
+
45
+ # RSpec files
46
+ rspec = dsl.rspec
47
+ watch(rspec.spec_helper) { rspec.spec_dir }
48
+ watch(rspec.spec_support) { rspec.spec_dir }
49
+ watch(rspec.spec_files)
50
+
51
+ # Ruby files
52
+ ruby = dsl.ruby
53
+ dsl.watch_spec_files_for(ruby.lib_files)
54
+
55
+ # Rails files
56
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
57
+ dsl.watch_spec_files_for(rails.app_files)
58
+ dsl.watch_spec_files_for(rails.views)
59
+
60
+ watch(rails.controllers) do |m|
61
+ [
62
+ rspec.spec.call("routing/#{m[1]}_routing"),
63
+ rspec.spec.call("controllers/#{m[1]}_controller"),
64
+ rspec.spec.call("acceptance/#{m[1]}")
65
+ ]
66
+ end
67
+
68
+ # Rails config changes
69
+ watch(rails.spec_helper) { rspec.spec_dir }
70
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
71
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
72
+
73
+ # Capybara features specs
74
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
75
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
76
+
77
+ # Turnip features and steps
78
+ watch(%r{^spec/acceptance/(.+)\.feature$})
79
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
80
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
81
+ end
82
+ end
@@ -0,0 +1,29 @@
1
+ Práctica 6: Desarrollo dirigido por Pruebas (TDD)
2
+
3
+ Autor: Eduardo Estévez Rodríguez
4
+
5
+ Descripción: La producción de alimentos es una de las principales causas del calentamiento global debido a las emisiones de gases de efecto invernadero. Por ello, se nos encomienda averiguar qué impacto ambiental tiene la dieta diaria de cualquier hombre y mujer adulta según las Ingestas Dietéticas de Referencia.
6
+
7
+ Práctica 7: POO. Listas
8
+
9
+ Autor: Eduardo Estévez Rodríguez
10
+
11
+ Descripción: Continuando la práctica anterior, nos dispondremos a generar diferentes dietas con sus respectivos porcentajes de nutrientes mediante la ayuda de listas doblemente enlazadas.
12
+
13
+ Práctica 8: Herencia. Módulos
14
+
15
+ Autor: Eduardo Estévez Rodríguez
16
+
17
+ Descripción: Continuando con la práctica número 7, nos disponemos a generar platos con los alimentos de las dietas que diseñamos para calcular así su informaciń nutricional y eficiencia energética.
18
+
19
+ Práctica 9: Programación funcional. Funciones de orden superior
20
+
21
+ Autor: Eduardo Estévez Rodríguez
22
+
23
+ Descripción: A partir de un conjunto de platos que conformen un menú dietético calcularemos la huella nutricional de cada uno de ellos y añadiremos un aumento de precio en base al precio del plato que mayor huella nutricional posea.
24
+
25
+ Práctica 10: Lenguajes de Dominio Específico
26
+
27
+ Autor: Eduardo Estévez Rodríguez
28
+
29
+ Descripción: Diseñar e implementar un Lenguaje de Dominio Específico Domain Specific Language - DSL, siguiendo la filosofía de Ruby que permita la definición de menús diéticos diarios y semanales.
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "feeding"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,699 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Alimento - RDoc Documentation</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ var index_rel_prefix = "./";
12
+ </script>
13
+
14
+ <script src="./js/jquery.js"></script>
15
+ <script src="./js/darkfish.js"></script>
16
+
17
+ <link href="./css/fonts.css" rel="stylesheet">
18
+ <link href="./css/rdoc.css" rel="stylesheet">
19
+
20
+
21
+
22
+
23
+ <body id="top" role="document" class="class">
24
+ <nav role="navigation">
25
+ <div id="project-navigation">
26
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
27
+ <h2>
28
+ <a href="./index.html" rel="home">Home</a>
29
+ </h2>
30
+
31
+ <div id="table-of-contents-navigation">
32
+ <a href="./table_of_contents.html#pages">Pages</a>
33
+ <a href="./table_of_contents.html#classes">Classes</a>
34
+ <a href="./table_of_contents.html#methods">Methods</a>
35
+ </div>
36
+ </div>
37
+
38
+ <div id="search-section" role="search" class="project-section initially-hidden">
39
+ <form action="#" method="get" accept-charset="utf-8">
40
+ <div id="search-field-wrapper">
41
+ <input id="search-field" role="combobox" aria-label="Search"
42
+ aria-autocomplete="list" aria-controls="search-results"
43
+ type="text" name="search" placeholder="Search" spellcheck="false"
44
+ title="Type to search, Up and Down to navigate, Enter to load">
45
+ </div>
46
+
47
+ <ul id="search-results" aria-label="Search Results"
48
+ aria-busy="false" aria-expanded="false"
49
+ aria-atomic="false" class="initially-hidden"></ul>
50
+ </form>
51
+ </div>
52
+
53
+ </div>
54
+
55
+
56
+
57
+ <div id="class-metadata">
58
+
59
+ <div id="parent-class-section" class="nav-section">
60
+ <h3>Parent</h3>
61
+
62
+
63
+ <p class="link"><a href="Object.html">Object</a>
64
+
65
+ </div>
66
+
67
+ <div id="includes-section" class="nav-section">
68
+ <h3>Included Modules</h3>
69
+
70
+ <ul class="link-list">
71
+
72
+
73
+ <li><span class="include">Comparable</span>
74
+
75
+
76
+ </ul>
77
+ </div>
78
+
79
+
80
+ <!-- Method Quickref -->
81
+ <div id="method-list-section" class="nav-section">
82
+ <h3>Methods</h3>
83
+
84
+ <ul class="link-list" role="directory">
85
+
86
+ <li ><a href="#method-c-new">::new</a>
87
+
88
+ <li ><a href="#method-i-3C-3D-3E">#&lt;=&gt;</a>
89
+
90
+ <li ><a href="#method-i-carbohidratos">#carbohidratos</a>
91
+
92
+ <li ><a href="#method-i-gases">#gases</a>
93
+
94
+ <li ><a href="#method-i-impacto">#impacto</a>
95
+
96
+ <li ><a href="#method-i-kcal">#kcal</a>
97
+
98
+ <li ><a href="#method-i-lipidos">#lipidos</a>
99
+
100
+ <li ><a href="#method-i-name">#name</a>
101
+
102
+ <li ><a href="#method-i-porcion_gases">#porcion_gases</a>
103
+
104
+ <li ><a href="#method-i-porcion_terreno">#porcion_terreno</a>
105
+
106
+ <li ><a href="#method-i-proteina">#proteina</a>
107
+
108
+ <li ><a href="#method-i-terreno">#terreno</a>
109
+
110
+ <li ><a href="#method-i-to_s">#to_s</a>
111
+
112
+ </ul>
113
+ </div>
114
+
115
+ </div>
116
+ </nav>
117
+
118
+ <main role="main" aria-labelledby="class-Alimento">
119
+ <h1 id="class-Alimento" class="class">
120
+ class Alimento
121
+ </h1>
122
+
123
+ <section class="description">
124
+ <dl class="rdoc-list note-list"><dt>Author
125
+ <dd>
126
+ <p>Eduardo Estévez Rodríguez (<a href="mailto:alu0101014319@ull.edu.es">alu0101014319@ull.edu.es</a>)</p>
127
+ </dd><dt>Copyright
128
+ <dd>
129
+ <p>Cretive Commons</p>
130
+ </dd><dt>License
131
+ <dd>
132
+ <p>Distributes under the same terms as Ruby</p>
133
+ </dd></dl>
134
+
135
+ </section>
136
+
137
+
138
+ <section id="5Buntitled-5D" class="documentation-section">
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <section class="attribute-method-details" class="method-section">
147
+ <header>
148
+ <h3>Attributes</h3>
149
+ </header>
150
+
151
+
152
+ <div id="attribute-i-ca" class="method-detail">
153
+ <div class="method-heading attribute-method-heading">
154
+ <span class="method-name">ca</span><span
155
+ class="attribute-access-type">[R]</span>
156
+ </div>
157
+
158
+ <div class="method-description">
159
+
160
+ <p>Se ha incluido el mixin Comparable </p>
161
+
162
+ </div>
163
+ </div>
164
+
165
+ <div id="attribute-i-gei" class="method-detail">
166
+ <div class="method-heading attribute-method-heading">
167
+ <span class="method-name">gei</span><span
168
+ class="attribute-access-type">[R]</span>
169
+ </div>
170
+
171
+ <div class="method-description">
172
+
173
+ <p>Se ha incluido el mixin Comparable </p>
174
+
175
+ </div>
176
+ </div>
177
+
178
+ <div id="attribute-i-li" class="method-detail">
179
+ <div class="method-heading attribute-method-heading">
180
+ <span class="method-name">li</span><span
181
+ class="attribute-access-type">[R]</span>
182
+ </div>
183
+
184
+ <div class="method-description">
185
+
186
+ <p>Se ha incluido el mixin Comparable </p>
187
+
188
+ </div>
189
+ </div>
190
+
191
+ <div id="attribute-i-no" class="method-detail">
192
+ <div class="method-heading attribute-method-heading">
193
+ <span class="method-name">no</span><span
194
+ class="attribute-access-type">[R]</span>
195
+ </div>
196
+
197
+ <div class="method-description">
198
+
199
+ <p>Se ha incluido el mixin Comparable </p>
200
+
201
+ </div>
202
+ </div>
203
+
204
+ <div id="attribute-i-pr" class="method-detail">
205
+ <div class="method-heading attribute-method-heading">
206
+ <span class="method-name">pr</span><span
207
+ class="attribute-access-type">[R]</span>
208
+ </div>
209
+
210
+ <div class="method-description">
211
+
212
+ <p>Se ha incluido el mixin Comparable </p>
213
+
214
+ </div>
215
+ </div>
216
+
217
+ <div id="attribute-i-te" class="method-detail">
218
+ <div class="method-heading attribute-method-heading">
219
+ <span class="method-name">te</span><span
220
+ class="attribute-access-type">[R]</span>
221
+ </div>
222
+
223
+ <div class="method-description">
224
+
225
+ <p>Se ha incluido el mixin Comparable </p>
226
+
227
+ </div>
228
+ </div>
229
+
230
+ </section>
231
+
232
+
233
+
234
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
235
+ <header>
236
+ <h3>Public Class Methods</h3>
237
+ </header>
238
+
239
+
240
+ <div id="method-c-new" class="method-detail ">
241
+
242
+ <div class="method-heading">
243
+ <span class="method-name">new</span><span
244
+ class="method-args">(no,pr,ca,li,gei,te)</span>
245
+
246
+ <span class="method-click-advice">click to toggle source</span>
247
+
248
+ </div>
249
+
250
+
251
+ <div class="method-description">
252
+
253
+ <p>Se asigna el nombre del alimento junto con su información nutricional e impacto ambiental</p>
254
+
255
+
256
+
257
+
258
+ <div class="method-source-code" id="new-source">
259
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 16</span>
260
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">no</span>,<span class="ruby-identifier">pr</span>,<span class="ruby-identifier">ca</span>,<span class="ruby-identifier">li</span>,<span class="ruby-identifier">gei</span>,<span class="ruby-identifier">te</span>)
261
+ <span class="ruby-ivar">@no</span> = <span class="ruby-identifier">no</span>
262
+ <span class="ruby-ivar">@pr</span> = <span class="ruby-identifier">pr</span>
263
+ <span class="ruby-ivar">@ca</span> = <span class="ruby-identifier">ca</span>
264
+ <span class="ruby-ivar">@li</span> = <span class="ruby-identifier">li</span>
265
+ <span class="ruby-ivar">@gei</span> = <span class="ruby-identifier">gei</span>
266
+ <span class="ruby-ivar">@te</span> = <span class="ruby-identifier">te</span>
267
+ <span class="ruby-keyword">end</span></pre>
268
+ </div>
269
+
270
+ </div>
271
+
272
+
273
+
274
+
275
+ </div>
276
+
277
+
278
+ </section>
279
+
280
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
281
+ <header>
282
+ <h3>Public Instance Methods</h3>
283
+ </header>
284
+
285
+
286
+ <div id="method-i-3C-3D-3E" class="method-detail ">
287
+
288
+ <div class="method-heading">
289
+ <span class="method-name">&lt;=&gt;</span><span
290
+ class="method-args">(other)</span>
291
+
292
+ <span class="method-click-advice">click to toggle source</span>
293
+
294
+ </div>
295
+
296
+
297
+ <div class="method-description">
298
+
299
+ <p>Se define para incluir el mixin comparable tomando como valor para la comparación la cantidad de kcalorías que posee el alimento</p>
300
+
301
+
302
+
303
+
304
+ <div class="method-source-code" id="3C-3D-3E-source">
305
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 86</span>
306
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">&lt;=&gt;</span>(<span class="ruby-identifier">other</span>)
307
+ <span class="ruby-identifier">kcal</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">kcal</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-carbohidratos" class="method-detail ">
320
+
321
+ <div class="method-heading">
322
+ <span class="method-name">carbohidratos</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>Devuelve la cantidad de carbohidratos que posee</p>
333
+
334
+
335
+
336
+
337
+ <div class="method-source-code" id="carbohidratos-source">
338
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 36</span>
339
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">carbohidratos</span>
340
+ <span class="ruby-ivar">@ca</span>
341
+ <span class="ruby-keyword">end</span></pre>
342
+ </div>
343
+
344
+ </div>
345
+
346
+
347
+
348
+
349
+ </div>
350
+
351
+
352
+ <div id="method-i-gases" class="method-detail ">
353
+
354
+ <div class="method-heading">
355
+ <span class="method-name">gases</span><span
356
+ class="method-args">()</span>
357
+
358
+ <span class="method-click-advice">click to toggle source</span>
359
+
360
+ </div>
361
+
362
+
363
+ <div class="method-description">
364
+
365
+ <p>Devuelve la cantidad de gases que emite anualmente</p>
366
+
367
+
368
+
369
+
370
+ <div class="method-source-code" id="gases-source">
371
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 46</span>
372
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gases</span>
373
+ <span class="ruby-ivar">@gei</span>
374
+ <span class="ruby-keyword">end</span></pre>
375
+ </div>
376
+
377
+ </div>
378
+
379
+
380
+
381
+
382
+ </div>
383
+
384
+
385
+ <div id="method-i-impacto" class="method-detail ">
386
+
387
+ <div class="method-heading">
388
+ <span class="method-name">impacto</span><span
389
+ class="method-args">(gr, alimento1,a1gr, alimento2,a2gr, alimento3,a3gr, alimento4,a4gr)</span>
390
+
391
+ <span class="method-click-advice">click to toggle source</span>
392
+
393
+ </div>
394
+
395
+
396
+ <div class="method-description">
397
+
398
+ <p>Devuelve el impacto ambiental diario que genera la alimentación de una persona adulta</p>
399
+
400
+
401
+
402
+
403
+ <div class="method-source-code" id="impacto-source">
404
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 66</span>
405
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">impacto</span>(<span class="ruby-identifier">gr</span>, <span class="ruby-identifier">alimento1</span>,<span class="ruby-identifier">a1gr</span>, <span class="ruby-identifier">alimento2</span>,<span class="ruby-identifier">a2gr</span>, <span class="ruby-identifier">alimento3</span>,<span class="ruby-identifier">a3gr</span>, <span class="ruby-identifier">alimento4</span>,<span class="ruby-identifier">a4gr</span>)
406
+ <span class="ruby-identifier">v_impacto</span> = []
407
+
408
+ <span class="ruby-identifier">v_impacto</span>[<span class="ruby-value">0</span>] = (<span class="ruby-identifier">porcion_gases</span>(<span class="ruby-identifier">gr</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">alimento1</span>.<span class="ruby-identifier">porcion_gases</span>(<span class="ruby-identifier">a1gr</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">alimento2</span>.<span class="ruby-identifier">porcion_gases</span>(<span class="ruby-identifier">a2gr</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">alimento3</span>.<span class="ruby-identifier">porcion_gases</span>(<span class="ruby-identifier">a3gr</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">alimento4</span>.<span class="ruby-identifier">porcion_gases</span>(<span class="ruby-identifier">a4gr</span>)).<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
409
+ <span class="ruby-identifier">v_impacto</span>[<span class="ruby-value">1</span>] = (<span class="ruby-identifier">porcion_terreno</span>(<span class="ruby-identifier">gr</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">alimento1</span>.<span class="ruby-identifier">porcion_terreno</span>(<span class="ruby-identifier">a1gr</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">alimento2</span>.<span class="ruby-identifier">porcion_terreno</span>(<span class="ruby-identifier">a2gr</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">alimento3</span>.<span class="ruby-identifier">porcion_terreno</span>(<span class="ruby-identifier">a3gr</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">alimento4</span>.<span class="ruby-identifier">porcion_terreno</span>(<span class="ruby-identifier">a4gr</span>)).<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
410
+
411
+ <span class="ruby-identifier">v_impacto</span>.<span class="ruby-identifier">to_s</span>
412
+ <span class="ruby-keyword">end</span></pre>
413
+ </div>
414
+
415
+ </div>
416
+
417
+
418
+
419
+
420
+ </div>
421
+
422
+
423
+ <div id="method-i-kcal" class="method-detail ">
424
+
425
+ <div class="method-heading">
426
+ <span class="method-name">kcal</span><span
427
+ class="method-args">()</span>
428
+
429
+ <span class="method-click-advice">click to toggle source</span>
430
+
431
+ </div>
432
+
433
+
434
+ <div class="method-description">
435
+
436
+ <p>Devuelve la cantidad de kcalorías que aporta</p>
437
+
438
+
439
+
440
+
441
+ <div class="method-source-code" id="kcal-source">
442
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 61</span>
443
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">kcal</span>
444
+ (<span class="ruby-ivar">@pr</span> <span class="ruby-operator">*</span> <span class="ruby-value">4</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@ca</span> <span class="ruby-operator">*</span> <span class="ruby-value">4</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@li</span> <span class="ruby-operator">*</span> <span class="ruby-value">9</span>).<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
445
+ <span class="ruby-keyword">end</span></pre>
446
+ </div>
447
+
448
+ </div>
449
+
450
+
451
+
452
+
453
+ </div>
454
+
455
+
456
+ <div id="method-i-lipidos" class="method-detail ">
457
+
458
+ <div class="method-heading">
459
+ <span class="method-name">lipidos</span><span
460
+ class="method-args">()</span>
461
+
462
+ <span class="method-click-advice">click to toggle source</span>
463
+
464
+ </div>
465
+
466
+
467
+ <div class="method-description">
468
+
469
+ <p>Devuelve la cantidad de lipidos que posee</p>
470
+
471
+
472
+
473
+
474
+ <div class="method-source-code" id="lipidos-source">
475
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 41</span>
476
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lipidos</span>
477
+ <span class="ruby-ivar">@li</span>
478
+ <span class="ruby-keyword">end</span></pre>
479
+ </div>
480
+
481
+ </div>
482
+
483
+
484
+
485
+
486
+ </div>
487
+
488
+
489
+ <div id="method-i-name" class="method-detail ">
490
+
491
+ <div class="method-heading">
492
+ <span class="method-name">name</span><span
493
+ class="method-args">()</span>
494
+
495
+ <span class="method-click-advice">click to toggle source</span>
496
+
497
+ </div>
498
+
499
+
500
+ <div class="method-description">
501
+
502
+ <p>Devuelve el nombre del alimento</p>
503
+
504
+
505
+
506
+
507
+ <div class="method-source-code" id="name-source">
508
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 26</span>
509
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">name</span>
510
+ <span class="ruby-ivar">@no</span>
511
+ <span class="ruby-keyword">end</span></pre>
512
+ </div>
513
+
514
+ </div>
515
+
516
+
517
+
518
+
519
+ </div>
520
+
521
+
522
+ <div id="method-i-porcion_gases" class="method-detail ">
523
+
524
+ <div class="method-heading">
525
+ <span class="method-name">porcion_gases</span><span
526
+ class="method-args">(gramos)</span>
527
+
528
+ <span class="method-click-advice">click to toggle source</span>
529
+
530
+ </div>
531
+
532
+
533
+ <div class="method-description">
534
+
535
+ <p>Calcula la cantidad de gases que emite cierta cantidad de gramos del alimento</p>
536
+
537
+
538
+
539
+
540
+ <div class="method-source-code" id="porcion_gases-source">
541
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 76</span>
542
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">porcion_gases</span>(<span class="ruby-identifier">gramos</span>)
543
+ <span class="ruby-identifier">gases</span> = ((<span class="ruby-identifier">gramos</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@gei</span>) <span class="ruby-operator">/</span> <span class="ruby-value">1000</span>).<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
544
+ <span class="ruby-keyword">end</span></pre>
545
+ </div>
546
+
547
+ </div>
548
+
549
+
550
+
551
+
552
+ </div>
553
+
554
+
555
+ <div id="method-i-porcion_terreno" class="method-detail ">
556
+
557
+ <div class="method-heading">
558
+ <span class="method-name">porcion_terreno</span><span
559
+ class="method-args">(gramos)</span>
560
+
561
+ <span class="method-click-advice">click to toggle source</span>
562
+
563
+ </div>
564
+
565
+
566
+ <div class="method-description">
567
+
568
+ <p>Calcula la cantidad de terreno que utiliza cierta cantidad de gramos del alimento para su producción</p>
569
+
570
+
571
+
572
+
573
+ <div class="method-source-code" id="porcion_terreno-source">
574
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 81</span>
575
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">porcion_terreno</span>(<span class="ruby-identifier">gramos</span>)
576
+ <span class="ruby-identifier">metros</span> = ((<span class="ruby-identifier">gramos</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@te</span>) <span class="ruby-operator">/</span> <span class="ruby-value">1000</span>).<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
577
+ <span class="ruby-keyword">end</span></pre>
578
+ </div>
579
+
580
+ </div>
581
+
582
+
583
+
584
+
585
+ </div>
586
+
587
+
588
+ <div id="method-i-proteina" class="method-detail ">
589
+
590
+ <div class="method-heading">
591
+ <span class="method-name">proteina</span><span
592
+ class="method-args">()</span>
593
+
594
+ <span class="method-click-advice">click to toggle source</span>
595
+
596
+ </div>
597
+
598
+
599
+ <div class="method-description">
600
+
601
+ <p>Devuelve la cantidad de proteínas que posee</p>
602
+
603
+
604
+
605
+
606
+ <div class="method-source-code" id="proteina-source">
607
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 31</span>
608
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">proteina</span>
609
+ <span class="ruby-ivar">@pr</span>
610
+ <span class="ruby-keyword">end</span></pre>
611
+ </div>
612
+
613
+ </div>
614
+
615
+
616
+
617
+
618
+ </div>
619
+
620
+
621
+ <div id="method-i-terreno" class="method-detail ">
622
+
623
+ <div class="method-heading">
624
+ <span class="method-name">terreno</span><span
625
+ class="method-args">()</span>
626
+
627
+ <span class="method-click-advice">click to toggle source</span>
628
+
629
+ </div>
630
+
631
+
632
+ <div class="method-description">
633
+
634
+ <p>Devuelve la cantidad de terreno que usa para su producción</p>
635
+
636
+
637
+
638
+
639
+ <div class="method-source-code" id="terreno-source">
640
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 51</span>
641
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">terreno</span>
642
+ <span class="ruby-ivar">@te</span>
643
+ <span class="ruby-keyword">end</span></pre>
644
+ </div>
645
+
646
+ </div>
647
+
648
+
649
+
650
+
651
+ </div>
652
+
653
+
654
+ <div id="method-i-to_s" class="method-detail ">
655
+
656
+ <div class="method-heading">
657
+ <span class="method-name">to_s</span><span
658
+ class="method-args">()</span>
659
+
660
+ <span class="method-click-advice">click to toggle source</span>
661
+
662
+ </div>
663
+
664
+
665
+ <div class="method-description">
666
+
667
+ <p>Devuelve el alimento formateado</p>
668
+
669
+
670
+
671
+
672
+ <div class="method-source-code" id="to_s-source">
673
+ <pre><span class="ruby-comment"># File lib/feeding/alimento.rb, line 56</span>
674
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
675
+ <span class="ruby-node">&quot;(#{@no}, #{@pr}, #{@ca}, #{@li}, #{@gei}, #{@te})&quot;</span>
676
+ <span class="ruby-keyword">end</span></pre>
677
+ </div>
678
+
679
+ </div>
680
+
681
+
682
+
683
+
684
+ </div>
685
+
686
+
687
+ </section>
688
+
689
+ </section>
690
+
691
+ </main>
692
+
693
+
694
+ <footer id="validator-badges" role="contentinfo">
695
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
696
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
697
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
698
+ </footer>
699
+