nutrientes_AkaiBF 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 67a8f9c54d58ddbbe0691e712f0c243461ad4804af9db7c52d452e73a8a2f0b9
4
+ data.tar.gz: b16e26724a655124e52e9c11faa561b8f6f6c13be1eb30f3adf35d65d4347a54
5
+ SHA512:
6
+ metadata.gz: e6c6a77b44f5cdc34acf2d77912e43fbdabc334a30b529401f641dda7fcf3c9e369c0f42975f6e654e81622231f61c05838bdab8cc0c4673e627e0ac7551e16a
7
+ data.tar.gz: 8c5aeda9866fc3dcaed2bdbd909d71d3dde723da2bd735f40767c884e20a4bf8a7f55e2c95bcce42291299993c5995541d56e9fef91f74d41a84d5040fa5ca26
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
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,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.0
5
+ before_install: gem install bundler -v 1.15.4
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at alu0100881622@ull.edu.es. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in nutrientes.gemspec
6
+ gemspec
data/Guardfile ADDED
@@ -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.exists?(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
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Ernesto Echeverría
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Práctica 6, 7 y 8: Test Driven Development, POO:Herencia y POO:Módulos
2
+ ### Lenguajes y Paradigmas de la Programación
3
+ #### Universidad de La Laguna
4
+ ##### Curso 2017-2018
5
+ > Por Ernesto Echeverría González
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'nutrientes'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install nutrientes
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/nutrientes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the Nutrientes project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/nutrientes/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
8
+ desc "Execute nutrientes"
9
+ task :nutrientes do
10
+ sh "ruby lib/nutrientes.rb"
11
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "nutrientes"
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__)
data/bin/setup ADDED
@@ -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,927 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Alimento
8
+
9
+ &mdash; Documentation by YARD 0.9.9
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Alimento";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (A)</a> &raquo;
40
+
41
+
42
+ <span class="title">Alimento</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Alimento
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Alimento</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <dl>
91
+ <dt>Includes:</dt>
92
+ <dd>Comparable</dd>
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>lib/nutrientes/alimento.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+ <h2>Overview</h2><div class="docstring">
108
+ <div class="discussion">
109
+
110
+ <p>Class Alimento Stores a food and some values of its elements.</p>
111
+
112
+
113
+ </div>
114
+ </div>
115
+ <div class="tags">
116
+
117
+
118
+ </div><div id="subclasses">
119
+ <h2>Direct Known Subclasses</h2>
120
+ <p class="children"><span class='object_link'><a href="Carbohidratado.html" title="Carbohidratado (class)">Carbohidratado</a></span>, <span class='object_link'><a href="Carnido.html" title="Carnido (class)">Carnido</a></span>, <span class='object_link'><a href="Fruta.html" title="Fruta (class)">Fruta</a></span>, <span class='object_link'><a href="Graso.html" title="Graso (class)">Graso</a></span>, <span class='object_link'><a href="OvoLacteo.html" title="OvoLacteo (class)">OvoLacteo</a></span>, <span class='object_link'><a href="Pescado.html" title="Pescado (class)">Pescado</a></span>, <span class='object_link'><a href="Verdura.html" title="Verdura (class)">Verdura</a></span></p>
121
+ </div>
122
+
123
+
124
+
125
+
126
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
127
+ <ul class="summary">
128
+
129
+ <li class="public ">
130
+ <span class="summary_signature">
131
+
132
+ <a href="#glucids-instance_method" title="#glucids (instance method)">#<strong>glucids</strong> &#x21d2; Object </a>
133
+
134
+
135
+
136
+ </span>
137
+
138
+
139
+
140
+
141
+ <span class="note title readonly">readonly</span>
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+ <span class="summary_desc"><div class='inline'>
152
+ <p>Returns the value of attribute glucids.</p>
153
+ </div></span>
154
+
155
+ </li>
156
+
157
+
158
+ <li class="public ">
159
+ <span class="summary_signature">
160
+
161
+ <a href="#lipids-instance_method" title="#lipids (instance method)">#<strong>lipids</strong> &#x21d2; Object </a>
162
+
163
+
164
+
165
+ </span>
166
+
167
+
168
+
169
+
170
+ <span class="note title readonly">readonly</span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <span class="summary_desc"><div class='inline'>
181
+ <p>Returns the value of attribute lipids.</p>
182
+ </div></span>
183
+
184
+ </li>
185
+
186
+
187
+ <li class="public ">
188
+ <span class="summary_signature">
189
+
190
+ <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
191
+
192
+
193
+
194
+ </span>
195
+
196
+
197
+
198
+
199
+ <span class="note title readonly">readonly</span>
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <span class="summary_desc"><div class='inline'>
210
+ <p>Returns the value of attribute name.</p>
211
+ </div></span>
212
+
213
+ </li>
214
+
215
+
216
+ <li class="public ">
217
+ <span class="summary_signature">
218
+
219
+ <a href="#proteins-instance_method" title="#proteins (instance method)">#<strong>proteins</strong> &#x21d2; Object </a>
220
+
221
+
222
+
223
+ </span>
224
+
225
+
226
+
227
+
228
+ <span class="note title readonly">readonly</span>
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+ <span class="summary_desc"><div class='inline'>
239
+ <p>Returns the value of attribute proteins.</p>
240
+ </div></span>
241
+
242
+ </li>
243
+
244
+
245
+ </ul>
246
+
247
+
248
+
249
+
250
+
251
+ <h2>
252
+ Instance Method Summary
253
+ <small><a href="#" class="summary_toggle">collapse</a></small>
254
+ </h2>
255
+
256
+ <ul class="summary">
257
+
258
+ <li class="public ">
259
+ <span class="summary_signature">
260
+
261
+ <a href="#<=>-instance_method" title="#&lt;=&gt; (instance method)">#<strong>&lt;=&gt;</strong>(another) &#x21d2; Fixnum </a>
262
+
263
+
264
+
265
+ </span>
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+ <span class="summary_desc"><div class='inline'>
276
+ <p>Method to implement the comparison between two Alimentos.</p>
277
+ </div></span>
278
+
279
+ </li>
280
+
281
+
282
+ <li class="public ">
283
+ <span class="summary_signature">
284
+
285
+ <a href="#caloric_value-instance_method" title="#caloric_value (instance method)">#<strong>caloric_value</strong> &#x21d2; Fixnum </a>
286
+
287
+
288
+
289
+ </span>
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+ <span class="summary_desc"><div class='inline'>
300
+ <p>Calculates the caloric value of the Alimento.</p>
301
+ </div></span>
302
+
303
+ </li>
304
+
305
+
306
+ <li class="public ">
307
+ <span class="summary_signature">
308
+
309
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, proteins, glucids, lipids) &#x21d2; Alimento </a>
310
+
311
+
312
+
313
+ </span>
314
+
315
+
316
+ <span class="note title constructor">constructor</span>
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+ <span class="summary_desc"><div class='inline'>
326
+ <p>Initialization of the object given its attributes.</p>
327
+ </div></span>
328
+
329
+ </li>
330
+
331
+
332
+ <li class="public ">
333
+ <span class="summary_signature">
334
+
335
+ <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; String </a>
336
+
337
+
338
+
339
+ </span>
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+ <span class="summary_desc"><div class='inline'>
350
+ <p>Method to transform an object of Alimento to a string.</p>
351
+ </div></span>
352
+
353
+ </li>
354
+
355
+
356
+ </ul>
357
+
358
+
359
+
360
+ <div id="constructor_details" class="method_details_list">
361
+ <h2>Constructor Details</h2>
362
+
363
+ <div class="method_details first">
364
+ <h3 class="signature first" id="initialize-instance_method">
365
+
366
+ #<strong>initialize</strong>(name, proteins, glucids, lipids) &#x21d2; <tt><span class='object_link'><a href="" title="Alimento (class)">Alimento</a></span></tt>
367
+
368
+
369
+
370
+
371
+
372
+ </h3><div class="docstring">
373
+ <div class="discussion">
374
+
375
+ <p>Initialization of the object given its attributes</p>
376
+
377
+
378
+ </div>
379
+ </div>
380
+ <div class="tags">
381
+ <p class="tag_title">Parameters:</p>
382
+ <ul class="param">
383
+
384
+ <li>
385
+
386
+ <span class='name'>name</span>
387
+
388
+
389
+ <span class='type'>(<tt>String</tt>)</span>
390
+
391
+
392
+
393
+ &mdash;
394
+ <div class='inline'>
395
+ <p>Name of the Alimento</p>
396
+ </div>
397
+
398
+ </li>
399
+
400
+ <li>
401
+
402
+ <span class='name'>proteins</span>
403
+
404
+
405
+ <span class='type'>(<tt>Fixnum</tt>)</span>
406
+
407
+
408
+
409
+ &mdash;
410
+ <div class='inline'>
411
+ <p>Proteins ammount of the Alimento</p>
412
+ </div>
413
+
414
+ </li>
415
+
416
+ <li>
417
+
418
+ <span class='name'>glucids</span>
419
+
420
+
421
+ <span class='type'>(<tt>Fixnum</tt>)</span>
422
+
423
+
424
+
425
+ &mdash;
426
+ <div class='inline'>
427
+ <p>Glucids ammount of the Alimento</p>
428
+ </div>
429
+
430
+ </li>
431
+
432
+ <li>
433
+
434
+ <span class='name'>lipids</span>
435
+
436
+
437
+ <span class='type'>(<tt>Fixnum</tt>)</span>
438
+
439
+
440
+
441
+ &mdash;
442
+ <div class='inline'>
443
+ <p>Lipids ammount of the Alimento</p>
444
+ </div>
445
+
446
+ </li>
447
+
448
+ </ul>
449
+
450
+
451
+ </div><table class="source_code">
452
+ <tr>
453
+ <td>
454
+ <pre class="lines">
455
+
456
+
457
+ 55
458
+ 56
459
+ 57
460
+ 58
461
+ 59
462
+ 60</pre>
463
+ </td>
464
+ <td>
465
+ <pre class="code"><span class="info file"># File 'lib/nutrientes/alimento.rb', line 55</span>
466
+
467
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_proteins'>proteins</span><span class='comma'>,</span> <span class='id identifier rubyid_glucids'>glucids</span><span class='comma'>,</span> <span class='id identifier rubyid_lipids'>lipids</span><span class='rparen'>)</span>
468
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
469
+ <span class='ivar'>@proteins</span> <span class='op'>=</span> <span class='id identifier rubyid_proteins'>proteins</span>
470
+ <span class='ivar'>@glucids</span> <span class='op'>=</span> <span class='id identifier rubyid_glucids'>glucids</span>
471
+ <span class='ivar'>@lipids</span> <span class='op'>=</span> <span class='id identifier rubyid_lipids'>lipids</span>
472
+ <span class='kw'>end</span></pre>
473
+ </td>
474
+ </tr>
475
+ </table>
476
+ </div>
477
+
478
+ </div>
479
+
480
+ <div id="instance_attr_details" class="attr_details">
481
+ <h2>Instance Attribute Details</h2>
482
+
483
+
484
+ <span id=""></span>
485
+ <div class="method_details first">
486
+ <h3 class="signature first" id="glucids-instance_method">
487
+
488
+ #<strong>glucids</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
489
+
490
+
491
+
492
+
493
+
494
+ </h3><div class="docstring">
495
+ <div class="discussion">
496
+
497
+ <p>Returns the value of attribute glucids</p>
498
+
499
+
500
+ </div>
501
+ </div>
502
+ <div class="tags">
503
+
504
+
505
+ </div><table class="source_code">
506
+ <tr>
507
+ <td>
508
+ <pre class="lines">
509
+
510
+
511
+ 13
512
+ 14
513
+ 15</pre>
514
+ </td>
515
+ <td>
516
+ <pre class="code"><span class="info file"># File 'lib/nutrientes/alimento.rb', line 13</span>
517
+
518
+ <span class='kw'>def</span> <span class='id identifier rubyid_glucids'>glucids</span>
519
+ <span class='ivar'>@glucids</span>
520
+ <span class='kw'>end</span></pre>
521
+ </td>
522
+ </tr>
523
+ </table>
524
+ </div>
525
+
526
+
527
+ <span id=""></span>
528
+ <div class="method_details ">
529
+ <h3 class="signature " id="lipids-instance_method">
530
+
531
+ #<strong>lipids</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
532
+
533
+
534
+
535
+
536
+
537
+ </h3><div class="docstring">
538
+ <div class="discussion">
539
+
540
+ <p>Returns the value of attribute lipids</p>
541
+
542
+
543
+ </div>
544
+ </div>
545
+ <div class="tags">
546
+
547
+
548
+ </div><table class="source_code">
549
+ <tr>
550
+ <td>
551
+ <pre class="lines">
552
+
553
+
554
+ 13
555
+ 14
556
+ 15</pre>
557
+ </td>
558
+ <td>
559
+ <pre class="code"><span class="info file"># File 'lib/nutrientes/alimento.rb', line 13</span>
560
+
561
+ <span class='kw'>def</span> <span class='id identifier rubyid_lipids'>lipids</span>
562
+ <span class='ivar'>@lipids</span>
563
+ <span class='kw'>end</span></pre>
564
+ </td>
565
+ </tr>
566
+ </table>
567
+ </div>
568
+
569
+
570
+ <span id=""></span>
571
+ <div class="method_details ">
572
+ <h3 class="signature " id="name-instance_method">
573
+
574
+ #<strong>name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
575
+
576
+
577
+
578
+
579
+
580
+ </h3><div class="docstring">
581
+ <div class="discussion">
582
+
583
+ <p>Returns the value of attribute name</p>
584
+
585
+
586
+ </div>
587
+ </div>
588
+ <div class="tags">
589
+
590
+
591
+ </div><table class="source_code">
592
+ <tr>
593
+ <td>
594
+ <pre class="lines">
595
+
596
+
597
+ 13
598
+ 14
599
+ 15</pre>
600
+ </td>
601
+ <td>
602
+ <pre class="code"><span class="info file"># File 'lib/nutrientes/alimento.rb', line 13</span>
603
+
604
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
605
+ <span class='ivar'>@name</span>
606
+ <span class='kw'>end</span></pre>
607
+ </td>
608
+ </tr>
609
+ </table>
610
+ </div>
611
+
612
+
613
+ <span id=""></span>
614
+ <div class="method_details ">
615
+ <h3 class="signature " id="proteins-instance_method">
616
+
617
+ #<strong>proteins</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
618
+
619
+
620
+
621
+
622
+
623
+ </h3><div class="docstring">
624
+ <div class="discussion">
625
+
626
+ <p>Returns the value of attribute proteins</p>
627
+
628
+
629
+ </div>
630
+ </div>
631
+ <div class="tags">
632
+
633
+
634
+ </div><table class="source_code">
635
+ <tr>
636
+ <td>
637
+ <pre class="lines">
638
+
639
+
640
+ 13
641
+ 14
642
+ 15</pre>
643
+ </td>
644
+ <td>
645
+ <pre class="code"><span class="info file"># File 'lib/nutrientes/alimento.rb', line 13</span>
646
+
647
+ <span class='kw'>def</span> <span class='id identifier rubyid_proteins'>proteins</span>
648
+ <span class='ivar'>@proteins</span>
649
+ <span class='kw'>end</span></pre>
650
+ </td>
651
+ </tr>
652
+ </table>
653
+ </div>
654
+
655
+ </div>
656
+
657
+
658
+ <div id="instance_method_details" class="method_details_list">
659
+ <h2>Instance Method Details</h2>
660
+
661
+
662
+ <div class="method_details first">
663
+ <h3 class="signature first" id="<=>-instance_method">
664
+
665
+ #<strong>&lt;=&gt;</strong>(another) &#x21d2; <tt>Fixnum</tt>
666
+
667
+
668
+
669
+
670
+
671
+ </h3><div class="docstring">
672
+ <div class="discussion">
673
+
674
+ <p>Method to implement the comparison between two Alimentos</p>
675
+
676
+
677
+ </div>
678
+ </div>
679
+ <div class="tags">
680
+ <p class="tag_title">Parameters:</p>
681
+ <ul class="param">
682
+
683
+ <li>
684
+
685
+ <span class='name'>another</span>
686
+
687
+
688
+ <span class='type'>(<tt>Object</tt>)</span>
689
+
690
+
691
+
692
+ &mdash;
693
+ <div class='inline'>
694
+ <p>Object to compare with</p>
695
+ </div>
696
+
697
+ </li>
698
+
699
+ </ul>
700
+
701
+ <p class="tag_title">Returns:</p>
702
+ <ul class="return">
703
+
704
+ <li>
705
+
706
+
707
+ <span class='type'>(<tt>Fixnum</tt>)</span>
708
+
709
+
710
+
711
+ &mdash;
712
+ <div class='inline'>
713
+ <p>1 if the first object is bigger, 0 if equal and -1 if minor</p>
714
+ </div>
715
+
716
+ </li>
717
+
718
+ </ul>
719
+
720
+ </div><table class="source_code">
721
+ <tr>
722
+ <td>
723
+ <pre class="lines">
724
+
725
+
726
+ 18
727
+ 19
728
+ 20
729
+ 21
730
+ 22
731
+ 23
732
+ 24
733
+ 25
734
+ 26
735
+ 27
736
+ 28
737
+ 29
738
+ 30
739
+ 31
740
+ 32
741
+ 33
742
+ 34
743
+ 35
744
+ 36
745
+ 37
746
+ 38
747
+ 39
748
+ 40
749
+ 41
750
+ 42
751
+ 43
752
+ 44
753
+ 45
754
+ 46
755
+ 47
756
+ 48</pre>
757
+ </td>
758
+ <td>
759
+ <pre class="code"><span class="info file"># File 'lib/nutrientes/alimento.rb', line 18</span>
760
+
761
+ <span class='kw'>def</span> <span class='op'>&lt;=&gt;</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='rparen'>)</span>
762
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_caloric_value'>caloric_value</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_caloric_value'>caloric_value</span><span class='rparen'>)</span>
763
+ <span class='kw'>return</span> <span class='op'>-</span><span class='int'>1</span>
764
+ <span class='kw'>else</span>
765
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_caloric_value'>caloric_value</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_caloric_value'>caloric_value</span><span class='rparen'>)</span>
766
+ <span class='kw'>return</span> <span class='int'>1</span>
767
+ <span class='kw'>end</span>
768
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_proteins'>proteins</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_proteins'>proteins</span><span class='rparen'>)</span>
769
+ <span class='kw'>return</span> <span class='op'>-</span><span class='int'>1</span>
770
+ <span class='kw'>else</span>
771
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_proteins'>proteins</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_proteins'>proteins</span><span class='rparen'>)</span>
772
+ <span class='kw'>return</span> <span class='int'>1</span>
773
+ <span class='kw'>end</span>
774
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_glucids'>glucids</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_glucids'>glucids</span><span class='rparen'>)</span>
775
+ <span class='kw'>return</span> <span class='op'>-</span><span class='int'>1</span>
776
+ <span class='kw'>else</span>
777
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_glucids'>glucids</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_glucids'>glucids</span><span class='rparen'>)</span>
778
+ <span class='kw'>return</span> <span class='int'>1</span>
779
+ <span class='kw'>end</span>
780
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_lipids'>lipids</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_lipids'>lipids</span><span class='rparen'>)</span>
781
+ <span class='kw'>return</span> <span class='op'>-</span><span class='int'>1</span>
782
+ <span class='kw'>else</span>
783
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_lipids'>lipids</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_lipids'>lipids</span><span class='rparen'>)</span>
784
+ <span class='kw'>return</span> <span class='int'>1</span>
785
+ <span class='kw'>else</span> <span class='kw'>return</span> <span class='int'>0</span>
786
+ <span class='kw'>end</span>
787
+ <span class='kw'>end</span>
788
+ <span class='kw'>end</span>
789
+ <span class='kw'>end</span>
790
+ <span class='kw'>end</span>
791
+ <span class='kw'>end</span></pre>
792
+ </td>
793
+ </tr>
794
+ </table>
795
+ </div>
796
+
797
+ <div class="method_details ">
798
+ <h3 class="signature " id="caloric_value-instance_method">
799
+
800
+ #<strong>caloric_value</strong> &#x21d2; <tt>Fixnum</tt>
801
+
802
+
803
+
804
+
805
+
806
+ </h3><div class="docstring">
807
+ <div class="discussion">
808
+
809
+ <p>Calculates the caloric value of the Alimento</p>
810
+
811
+
812
+ </div>
813
+ </div>
814
+ <div class="tags">
815
+
816
+ <p class="tag_title">Returns:</p>
817
+ <ul class="return">
818
+
819
+ <li>
820
+
821
+
822
+ <span class='type'>(<tt>Fixnum</tt>)</span>
823
+
824
+
825
+
826
+ &mdash;
827
+ <div class='inline'>
828
+ <p>The caloric value</p>
829
+ </div>
830
+
831
+ </li>
832
+
833
+ </ul>
834
+
835
+ </div><table class="source_code">
836
+ <tr>
837
+ <td>
838
+ <pre class="lines">
839
+
840
+
841
+ 70
842
+ 71
843
+ 72</pre>
844
+ </td>
845
+ <td>
846
+ <pre class="code"><span class="info file"># File 'lib/nutrientes/alimento.rb', line 70</span>
847
+
848
+ <span class='kw'>def</span> <span class='id identifier rubyid_caloric_value'>caloric_value</span><span class='lparen'>(</span><span class='rparen'>)</span>
849
+ <span class='kw'>return</span> <span class='lparen'>(</span><span class='ivar'>@proteins</span> <span class='op'>*</span> <span class='int'>4</span> <span class='op'>+</span> <span class='ivar'>@lipids</span> <span class='op'>*</span> <span class='int'>9</span> <span class='op'>+</span> <span class='ivar'>@glucids</span> <span class='op'>*</span> <span class='int'>4</span><span class='rparen'>)</span>
850
+ <span class='kw'>end</span></pre>
851
+ </td>
852
+ </tr>
853
+ </table>
854
+ </div>
855
+
856
+ <div class="method_details ">
857
+ <h3 class="signature " id="to_s-instance_method">
858
+
859
+ #<strong>to_s</strong> &#x21d2; <tt>String</tt>
860
+
861
+
862
+
863
+
864
+
865
+ </h3><div class="docstring">
866
+ <div class="discussion">
867
+
868
+ <p>Method to transform an object of Alimento to a string</p>
869
+
870
+
871
+ </div>
872
+ </div>
873
+ <div class="tags">
874
+
875
+ <p class="tag_title">Returns:</p>
876
+ <ul class="return">
877
+
878
+ <li>
879
+
880
+
881
+ <span class='type'>(<tt>String</tt>)</span>
882
+
883
+
884
+
885
+ &mdash;
886
+ <div class='inline'>
887
+ <p>the object as a string</p>
888
+ </div>
889
+
890
+ </li>
891
+
892
+ </ul>
893
+
894
+ </div><table class="source_code">
895
+ <tr>
896
+ <td>
897
+ <pre class="lines">
898
+
899
+
900
+ 64
901
+ 65
902
+ 66</pre>
903
+ </td>
904
+ <td>
905
+ <pre class="code"><span class="info file"># File 'lib/nutrientes/alimento.rb', line 64</span>
906
+
907
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='rparen'>)</span>
908
+ <span class='kw'>return</span> <span class='const'>String</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@name</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='ivar'>@proteins</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>g proteins, </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='ivar'>@glucids</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>g glucids, </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='ivar'>@lipids</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>g lipids</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
909
+ <span class='kw'>end</span></pre>
910
+ </td>
911
+ </tr>
912
+ </table>
913
+ </div>
914
+
915
+ </div>
916
+
917
+ </div>
918
+
919
+ <div id="footer">
920
+ Generated on Wed Nov 15 09:37:58 2017 by
921
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
922
+ 0.9.9 (ruby-2.3.0).
923
+ </div>
924
+
925
+ </div>
926
+ </body>
927
+ </html>