Alimento0100956269 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.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Alimento.gemspec +39 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +7 -0
- data/_config.yml +1 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Alimento.html +117 -0
- data/docs/Comida.html +1075 -0
- data/docs/Comida_clasif.html +396 -0
- data/docs/List.html +1062 -0
- data/docs/Node.html +409 -0
- data/docs/_index.html +151 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +492 -0
- data/docs/file.README.html +126 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +126 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +299 -0
- data/docs/top-level-namespace.html +112 -0
- data/lib/Alimento.rb +9 -0
- data/lib/Alimento/Comida.rb +169 -0
- data/lib/Alimento/List.rb +152 -0
- data/lib/Alimento/Plato.rb +160 -0
- data/lib/Alimento/version.rb +3 -0
- metadata +181 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8c5f0d653eac524e0dfe1840742dc1580eba1906
|
4
|
+
data.tar.gz: 6af347a2e0fd04eb648a4072967b972c2e16ade2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d8751ad24d8be47dbe68d1ba16968446455d1ec781defc80222427aeb67c5aa6628181c0fde812d8966b40ccd9669858fd9ae9ea56ed548e5efc87fcfcd98f34
|
7
|
+
data.tar.gz: f61e64560a733de68d77cee483aef7ff27b449f7db3d5251b24ab82abb239f435219e147b80164f738106ed25ff8500c0788203727ce516873b94eb1c0a378f6
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service-name: travis-ci
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Alimento.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'Alimento/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "Alimento0100956269"
|
8
|
+
spec.version = Alimento::VERSION
|
9
|
+
spec.authors = ["Juan_Carlos_Glez_Pascolo"]
|
10
|
+
spec.email = ["alu0100956269@ull.edu.es"]
|
11
|
+
|
12
|
+
spec.summary = "A gem to the food"
|
13
|
+
#spec.description = %q{TODO: Write a longer description or delete this line.}
|
14
|
+
spec.homepage = "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100956269"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
21
|
+
else
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
33
|
+
|
34
|
+
spec.add_development_dependency "guard"
|
35
|
+
spec.add_development_dependency "guard-rspec"
|
36
|
+
spec.add_development_dependency "guard-bundler"
|
37
|
+
|
38
|
+
spec.add_development_dependency "coveralls"
|
39
|
+
end
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at alu0100956269@ull.edu.es. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
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 Juan_Carlos_Glez_Pascolo
|
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,41 @@
|
|
1
|
+
# Alimento
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/Alimento`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
Añadido Travis
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'Alimento'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install Alimento
|
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]/Alimento. 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
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
data/_config.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
theme: jekyll-theme-slate
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "Alimento"
|
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
|
data/bin/setup
ADDED
data/docs/Alimento.html
ADDED
@@ -0,0 +1,117 @@
|
|
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
|
+
Module: Alimento
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "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> »
|
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>Module: Alimento
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/Alimento.rb<span class="defines">,<br />
|
82
|
+
lib/Alimento/version.rb</span>
|
83
|
+
</dd>
|
84
|
+
</dl>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
<h2>Constant Summary</h2>
|
90
|
+
<dl class="constants">
|
91
|
+
|
92
|
+
<dt id="VERSION-constant" class="">VERSION =
|
93
|
+
|
94
|
+
</dt>
|
95
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.1.0</span><span class='tstring_end'>"</span></span></pre></dd>
|
96
|
+
|
97
|
+
</dl>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div id="footer">
|
110
|
+
Generated on Wed Nov 15 11:43:17 2017 by
|
111
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
112
|
+
0.9.9 (ruby-2.3.1).
|
113
|
+
</div>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</body>
|
117
|
+
</html>
|
data/docs/Comida.html
ADDED
@@ -0,0 +1,1075 @@
|
|
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: Comida
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Comida";
|
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 (C)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Comida</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: Comida
|
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">Comida</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/Alimento/Comida.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
108
|
+
<div class="discussion">
|
109
|
+
|
110
|
+
<p>Esta clase permite ver los distintos componentes de un alimento y su valor
|
111
|
+
energético Se ha incluido el mixin Comparable</p>
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="tags">
|
117
|
+
|
118
|
+
|
119
|
+
</div><div id="subclasses">
|
120
|
+
<h2>Direct Known Subclasses</h2>
|
121
|
+
<p class="children"><span class='object_link'><a href="Comida_clasif.html" title="Comida_clasif (class)">Comida_clasif</a></span></p>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
128
|
+
<ul class="summary">
|
129
|
+
|
130
|
+
<li class="public ">
|
131
|
+
<span class="summary_signature">
|
132
|
+
|
133
|
+
<a href="#carbohydrates-instance_method" title="#carbohydrates (instance method)">#<strong>carbohydrates</strong> ⇒ Object </a>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<span class="note title readonly">readonly</span>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<span class="summary_desc"><div class='inline'>
|
153
|
+
<p>Getters de las distintas variables de instancia.</p>
|
154
|
+
</div></span>
|
155
|
+
|
156
|
+
</li>
|
157
|
+
|
158
|
+
|
159
|
+
<li class="public ">
|
160
|
+
<span class="summary_signature">
|
161
|
+
|
162
|
+
<a href="#lipids-instance_method" title="#lipids (instance method)">#<strong>lipids</strong> ⇒ Object </a>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</span>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="note title readonly">readonly</span>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<span class="summary_desc"><div class='inline'>
|
182
|
+
<p>Getters de las distintas variables de instancia.</p>
|
183
|
+
</div></span>
|
184
|
+
|
185
|
+
</li>
|
186
|
+
|
187
|
+
|
188
|
+
<li class="public ">
|
189
|
+
<span class="summary_signature">
|
190
|
+
|
191
|
+
<a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> ⇒ Object </a>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
</span>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
<span class="note title readonly">readonly</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="summary_desc"><div class='inline'>
|
211
|
+
<p>Getters de las distintas variables de instancia.</p>
|
212
|
+
</div></span>
|
213
|
+
|
214
|
+
</li>
|
215
|
+
|
216
|
+
|
217
|
+
<li class="public ">
|
218
|
+
<span class="summary_signature">
|
219
|
+
|
220
|
+
<a href="#proteins-instance_method" title="#proteins (instance method)">#<strong>proteins</strong> ⇒ Object </a>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</span>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
<span class="note title readonly">readonly</span>
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<span class="summary_desc"><div class='inline'>
|
240
|
+
<p>Getters de las distintas variables de instancia.</p>
|
241
|
+
</div></span>
|
242
|
+
|
243
|
+
</li>
|
244
|
+
|
245
|
+
|
246
|
+
</ul>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
<h2>
|
253
|
+
Instance Method Summary
|
254
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
255
|
+
</h2>
|
256
|
+
|
257
|
+
<ul class="summary">
|
258
|
+
|
259
|
+
<li class="public ">
|
260
|
+
<span class="summary_signature">
|
261
|
+
|
262
|
+
<a href="#<=>-instance_method" title="#<=> (instance method)">#<strong><=></strong>(other_food) ⇒ Object </a>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
</span>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
<span class="summary_desc"><div class='inline'>
|
277
|
+
<p>Se define para incluir el mixin comparable Se toma como valor para la
|
278
|
+
comparación el valor energético y para saber si son iguales también se toma
|
279
|
+
el nombre.</p>
|
280
|
+
</div></span>
|
281
|
+
|
282
|
+
</li>
|
283
|
+
|
284
|
+
|
285
|
+
<li class="public ">
|
286
|
+
<span class="summary_signature">
|
287
|
+
|
288
|
+
<a href="#==-instance_method" title="#== (instance method)">#<strong>==</strong>(other_food) ⇒ Object </a>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</span>
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
<span class="summary_desc"><div class='inline'>
|
303
|
+
<p>para comparar se debe pasar otra comida como argumento.</p>
|
304
|
+
</div></span>
|
305
|
+
|
306
|
+
</li>
|
307
|
+
|
308
|
+
|
309
|
+
<li class="public ">
|
310
|
+
<span class="summary_signature">
|
311
|
+
|
312
|
+
<a href="#format_ch-instance_method" title="#format_ch (instance method)">#<strong>format_ch</strong> ⇒ Object </a>
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
</span>
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
<span class="summary_desc"><div class='inline'>
|
327
|
+
<p>Función que devuelve las kcalorias del alimento por su número de glúcidos.</p>
|
328
|
+
</div></span>
|
329
|
+
|
330
|
+
</li>
|
331
|
+
|
332
|
+
|
333
|
+
<li class="public ">
|
334
|
+
<span class="summary_signature">
|
335
|
+
|
336
|
+
<a href="#format_lipids-instance_method" title="#format_lipids (instance method)">#<strong>format_lipids</strong> ⇒ Object </a>
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
</span>
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
<span class="summary_desc"><div class='inline'>
|
351
|
+
<p>Función que devuelve las kcalorias del alimento por su número de lípidos.</p>
|
352
|
+
</div></span>
|
353
|
+
|
354
|
+
</li>
|
355
|
+
|
356
|
+
|
357
|
+
<li class="public ">
|
358
|
+
<span class="summary_signature">
|
359
|
+
|
360
|
+
<a href="#format_proteins-instance_method" title="#format_proteins (instance method)">#<strong>format_proteins</strong> ⇒ Object </a>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
</span>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
<span class="summary_desc"><div class='inline'>
|
375
|
+
<p>Función que devuelve las kcalorias del alimento por su número de proteinas.</p>
|
376
|
+
</div></span>
|
377
|
+
|
378
|
+
</li>
|
379
|
+
|
380
|
+
|
381
|
+
<li class="public ">
|
382
|
+
<span class="summary_signature">
|
383
|
+
|
384
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name_value, proteins_value, carbohydrates_value, lipids_value) ⇒ Comida </a>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
</span>
|
389
|
+
|
390
|
+
|
391
|
+
<span class="note title constructor">constructor</span>
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
<span class="summary_desc"><div class='inline'>
|
401
|
+
<p>Se asignan los valores que debe tener el alimento, es decir, su nombre,
|
402
|
+
numero de proteinas, glúcidos (carbohidratos) y lípidos.</p>
|
403
|
+
</div></span>
|
404
|
+
|
405
|
+
</li>
|
406
|
+
|
407
|
+
|
408
|
+
<li class="public ">
|
409
|
+
<span class="summary_signature">
|
410
|
+
|
411
|
+
<a href="#show_ev-instance_method" title="#show_ev (instance method)">#<strong>show_ev</strong> ⇒ Object </a>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
</span>
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
<span class="summary_desc"><div class='inline'>
|
426
|
+
<p>Metodo que convierte a string los componentes del alimento en kcaloría y su
|
427
|
+
valor energético total.</p>
|
428
|
+
</div></span>
|
429
|
+
|
430
|
+
</li>
|
431
|
+
|
432
|
+
|
433
|
+
<li class="public ">
|
434
|
+
<span class="summary_signature">
|
435
|
+
|
436
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> ⇒ Object </a>
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
</span>
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
<span class="summary_desc"><div class='inline'>
|
451
|
+
<p>Función to_string.</p>
|
452
|
+
</div></span>
|
453
|
+
|
454
|
+
</li>
|
455
|
+
|
456
|
+
|
457
|
+
<li class="public ">
|
458
|
+
<span class="summary_signature">
|
459
|
+
|
460
|
+
<a href="#val_energ-instance_method" title="#val_energ (instance method)">#<strong>val_energ</strong> ⇒ Object </a>
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
</span>
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
<span class="summary_desc"><div class='inline'>
|
475
|
+
<p>Función que devuelve las kcalorias totales del alimento.</p>
|
476
|
+
</div></span>
|
477
|
+
|
478
|
+
</li>
|
479
|
+
|
480
|
+
|
481
|
+
</ul>
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
<div id="constructor_details" class="method_details_list">
|
486
|
+
<h2>Constructor Details</h2>
|
487
|
+
|
488
|
+
<div class="method_details first">
|
489
|
+
<h3 class="signature first" id="initialize-instance_method">
|
490
|
+
|
491
|
+
#<strong>initialize</strong>(name_value, proteins_value, carbohydrates_value, lipids_value) ⇒ <tt><span class='object_link'><a href="" title="Comida (class)">Comida</a></span></tt>
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
</h3><div class="docstring">
|
498
|
+
<div class="discussion">
|
499
|
+
|
500
|
+
<p>Se asignan los valores que debe tener el alimento, es decir, su nombre,
|
501
|
+
numero de proteinas, glúcidos (carbohidratos) y lípidos</p>
|
502
|
+
|
503
|
+
|
504
|
+
</div>
|
505
|
+
</div>
|
506
|
+
<div class="tags">
|
507
|
+
|
508
|
+
|
509
|
+
</div><table class="source_code">
|
510
|
+
<tr>
|
511
|
+
<td>
|
512
|
+
<pre class="lines">
|
513
|
+
|
514
|
+
|
515
|
+
16
|
516
|
+
17
|
517
|
+
18
|
518
|
+
19
|
519
|
+
20
|
520
|
+
21</pre>
|
521
|
+
</td>
|
522
|
+
<td>
|
523
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 16</span>
|
524
|
+
|
525
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='id identifier rubyid_name_value'>name_value</span><span class='comma'>,</span> <span class='id identifier rubyid_proteins_value'>proteins_value</span><span class='comma'>,</span> <span class='id identifier rubyid_carbohydrates_value'>carbohydrates_value</span><span class='comma'>,</span> <span class='id identifier rubyid_lipids_value'>lipids_value</span><span class='rparen'>)</span>
|
526
|
+
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name_value'>name_value</span>
|
527
|
+
<span class='ivar'>@proteins</span> <span class='op'>=</span> <span class='id identifier rubyid_proteins_value'>proteins_value</span>
|
528
|
+
<span class='ivar'>@carbohydrates</span> <span class='op'>=</span> <span class='id identifier rubyid_carbohydrates_value'>carbohydrates_value</span>
|
529
|
+
<span class='ivar'>@lipids</span> <span class='op'>=</span> <span class='id identifier rubyid_lipids_value'>lipids_value</span>
|
530
|
+
<span class='kw'>end</span></pre>
|
531
|
+
</td>
|
532
|
+
</tr>
|
533
|
+
</table>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
</div>
|
537
|
+
|
538
|
+
<div id="instance_attr_details" class="attr_details">
|
539
|
+
<h2>Instance Attribute Details</h2>
|
540
|
+
|
541
|
+
|
542
|
+
<span id=""></span>
|
543
|
+
<div class="method_details first">
|
544
|
+
<h3 class="signature first" id="carbohydrates-instance_method">
|
545
|
+
|
546
|
+
#<strong>carbohydrates</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
</h3><div class="docstring">
|
553
|
+
<div class="discussion">
|
554
|
+
|
555
|
+
<p>Getters de las distintas variables de instancia</p>
|
556
|
+
|
557
|
+
|
558
|
+
</div>
|
559
|
+
</div>
|
560
|
+
<div class="tags">
|
561
|
+
|
562
|
+
|
563
|
+
</div><table class="source_code">
|
564
|
+
<tr>
|
565
|
+
<td>
|
566
|
+
<pre class="lines">
|
567
|
+
|
568
|
+
|
569
|
+
12
|
570
|
+
13
|
571
|
+
14</pre>
|
572
|
+
</td>
|
573
|
+
<td>
|
574
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 12</span>
|
575
|
+
|
576
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_carbohydrates'>carbohydrates</span>
|
577
|
+
<span class='ivar'>@carbohydrates</span>
|
578
|
+
<span class='kw'>end</span></pre>
|
579
|
+
</td>
|
580
|
+
</tr>
|
581
|
+
</table>
|
582
|
+
</div>
|
583
|
+
|
584
|
+
|
585
|
+
<span id=""></span>
|
586
|
+
<div class="method_details ">
|
587
|
+
<h3 class="signature " id="lipids-instance_method">
|
588
|
+
|
589
|
+
#<strong>lipids</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
</h3><div class="docstring">
|
596
|
+
<div class="discussion">
|
597
|
+
|
598
|
+
<p>Getters de las distintas variables de instancia</p>
|
599
|
+
|
600
|
+
|
601
|
+
</div>
|
602
|
+
</div>
|
603
|
+
<div class="tags">
|
604
|
+
|
605
|
+
|
606
|
+
</div><table class="source_code">
|
607
|
+
<tr>
|
608
|
+
<td>
|
609
|
+
<pre class="lines">
|
610
|
+
|
611
|
+
|
612
|
+
12
|
613
|
+
13
|
614
|
+
14</pre>
|
615
|
+
</td>
|
616
|
+
<td>
|
617
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 12</span>
|
618
|
+
|
619
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_lipids'>lipids</span>
|
620
|
+
<span class='ivar'>@lipids</span>
|
621
|
+
<span class='kw'>end</span></pre>
|
622
|
+
</td>
|
623
|
+
</tr>
|
624
|
+
</table>
|
625
|
+
</div>
|
626
|
+
|
627
|
+
|
628
|
+
<span id=""></span>
|
629
|
+
<div class="method_details ">
|
630
|
+
<h3 class="signature " id="name-instance_method">
|
631
|
+
|
632
|
+
#<strong>name</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
</h3><div class="docstring">
|
639
|
+
<div class="discussion">
|
640
|
+
|
641
|
+
<p>Getters de las distintas variables de instancia</p>
|
642
|
+
|
643
|
+
|
644
|
+
</div>
|
645
|
+
</div>
|
646
|
+
<div class="tags">
|
647
|
+
|
648
|
+
|
649
|
+
</div><table class="source_code">
|
650
|
+
<tr>
|
651
|
+
<td>
|
652
|
+
<pre class="lines">
|
653
|
+
|
654
|
+
|
655
|
+
12
|
656
|
+
13
|
657
|
+
14</pre>
|
658
|
+
</td>
|
659
|
+
<td>
|
660
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 12</span>
|
661
|
+
|
662
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
663
|
+
<span class='ivar'>@name</span>
|
664
|
+
<span class='kw'>end</span></pre>
|
665
|
+
</td>
|
666
|
+
</tr>
|
667
|
+
</table>
|
668
|
+
</div>
|
669
|
+
|
670
|
+
|
671
|
+
<span id=""></span>
|
672
|
+
<div class="method_details ">
|
673
|
+
<h3 class="signature " id="proteins-instance_method">
|
674
|
+
|
675
|
+
#<strong>proteins</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
</h3><div class="docstring">
|
682
|
+
<div class="discussion">
|
683
|
+
|
684
|
+
<p>Getters de las distintas variables de instancia</p>
|
685
|
+
|
686
|
+
|
687
|
+
</div>
|
688
|
+
</div>
|
689
|
+
<div class="tags">
|
690
|
+
|
691
|
+
|
692
|
+
</div><table class="source_code">
|
693
|
+
<tr>
|
694
|
+
<td>
|
695
|
+
<pre class="lines">
|
696
|
+
|
697
|
+
|
698
|
+
12
|
699
|
+
13
|
700
|
+
14</pre>
|
701
|
+
</td>
|
702
|
+
<td>
|
703
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 12</span>
|
704
|
+
|
705
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_proteins'>proteins</span>
|
706
|
+
<span class='ivar'>@proteins</span>
|
707
|
+
<span class='kw'>end</span></pre>
|
708
|
+
</td>
|
709
|
+
</tr>
|
710
|
+
</table>
|
711
|
+
</div>
|
712
|
+
|
713
|
+
</div>
|
714
|
+
|
715
|
+
|
716
|
+
<div id="instance_method_details" class="method_details_list">
|
717
|
+
<h2>Instance Method Details</h2>
|
718
|
+
|
719
|
+
|
720
|
+
<div class="method_details first">
|
721
|
+
<h3 class="signature first" id="<=>-instance_method">
|
722
|
+
|
723
|
+
#<strong><=></strong>(other_food) ⇒ <tt>Object</tt>
|
724
|
+
|
725
|
+
|
726
|
+
|
727
|
+
|
728
|
+
|
729
|
+
</h3><div class="docstring">
|
730
|
+
<div class="discussion">
|
731
|
+
|
732
|
+
<p>Se define para incluir el mixin comparable Se toma como valor para la
|
733
|
+
comparación el valor energético y para saber si son iguales también se toma
|
734
|
+
el nombre.</p>
|
735
|
+
|
736
|
+
|
737
|
+
</div>
|
738
|
+
</div>
|
739
|
+
<div class="tags">
|
740
|
+
|
741
|
+
|
742
|
+
</div><table class="source_code">
|
743
|
+
<tr>
|
744
|
+
<td>
|
745
|
+
<pre class="lines">
|
746
|
+
|
747
|
+
|
748
|
+
67
|
749
|
+
68
|
750
|
+
69
|
751
|
+
70</pre>
|
752
|
+
</td>
|
753
|
+
<td>
|
754
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 67</span>
|
755
|
+
|
756
|
+
<span class='kw'>def</span> <span class='op'><=></span><span class='lparen'>(</span><span class='id identifier rubyid_other_food'>other_food</span><span class='rparen'>)</span>
|
757
|
+
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_other_food'>other_food</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='const'>Comida</span>
|
758
|
+
<span class='id identifier rubyid_val_energ'>val_energ</span> <span class='op'><=></span> <span class='id identifier rubyid_other_food'>other_food</span><span class='period'>.</span><span class='id identifier rubyid_val_energ'>val_energ</span>
|
759
|
+
<span class='kw'>end</span></pre>
|
760
|
+
</td>
|
761
|
+
</tr>
|
762
|
+
</table>
|
763
|
+
</div>
|
764
|
+
|
765
|
+
<div class="method_details ">
|
766
|
+
<h3 class="signature " id="==-instance_method">
|
767
|
+
|
768
|
+
#<strong>==</strong>(other_food) ⇒ <tt>Object</tt>
|
769
|
+
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
|
774
|
+
</h3><div class="docstring">
|
775
|
+
<div class="discussion">
|
776
|
+
|
777
|
+
<p>para comparar se debe pasar otra comida como argumento</p>
|
778
|
+
|
779
|
+
|
780
|
+
</div>
|
781
|
+
</div>
|
782
|
+
<div class="tags">
|
783
|
+
|
784
|
+
|
785
|
+
</div><table class="source_code">
|
786
|
+
<tr>
|
787
|
+
<td>
|
788
|
+
<pre class="lines">
|
789
|
+
|
790
|
+
|
791
|
+
73
|
792
|
+
74
|
793
|
+
75
|
794
|
+
76</pre>
|
795
|
+
</td>
|
796
|
+
<td>
|
797
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 73</span>
|
798
|
+
|
799
|
+
<span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other_food'>other_food</span><span class='rparen'>)</span>
|
800
|
+
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_other_food'>other_food</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='const'>Comida</span>
|
801
|
+
<span class='lparen'>(</span><span class='ivar'>@name</span> <span class='op'>==</span> <span class='id identifier rubyid_other_food'>other_food</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_val_energ'>val_energ</span> <span class='op'>==</span> <span class='id identifier rubyid_other_food'>other_food</span><span class='period'>.</span><span class='id identifier rubyid_val_energ'>val_energ</span><span class='rparen'>)</span>
|
802
|
+
<span class='kw'>end</span></pre>
|
803
|
+
</td>
|
804
|
+
</tr>
|
805
|
+
</table>
|
806
|
+
</div>
|
807
|
+
|
808
|
+
<div class="method_details ">
|
809
|
+
<h3 class="signature " id="format_ch-instance_method">
|
810
|
+
|
811
|
+
#<strong>format_ch</strong> ⇒ <tt>Object</tt>
|
812
|
+
|
813
|
+
|
814
|
+
|
815
|
+
|
816
|
+
|
817
|
+
</h3><div class="docstring">
|
818
|
+
<div class="discussion">
|
819
|
+
|
820
|
+
<p>Función que devuelve las kcalorias del alimento por su número de glúcidos</p>
|
821
|
+
|
822
|
+
|
823
|
+
</div>
|
824
|
+
</div>
|
825
|
+
<div class="tags">
|
826
|
+
|
827
|
+
|
828
|
+
</div><table class="source_code">
|
829
|
+
<tr>
|
830
|
+
<td>
|
831
|
+
<pre class="lines">
|
832
|
+
|
833
|
+
|
834
|
+
39
|
835
|
+
40
|
836
|
+
41
|
837
|
+
42</pre>
|
838
|
+
</td>
|
839
|
+
<td>
|
840
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 39</span>
|
841
|
+
|
842
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format_ch'>format_ch</span>
|
843
|
+
<span class='id identifier rubyid_ch_kcal'>ch_kcal</span> <span class='op'>=</span> <span class='ivar'>@carbohydrates</span> <span class='op'>*</span> <span class='int'>4</span>
|
844
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_ch_kcal'>ch_kcal</span>
|
845
|
+
<span class='kw'>end</span></pre>
|
846
|
+
</td>
|
847
|
+
</tr>
|
848
|
+
</table>
|
849
|
+
</div>
|
850
|
+
|
851
|
+
<div class="method_details ">
|
852
|
+
<h3 class="signature " id="format_lipids-instance_method">
|
853
|
+
|
854
|
+
#<strong>format_lipids</strong> ⇒ <tt>Object</tt>
|
855
|
+
|
856
|
+
|
857
|
+
|
858
|
+
|
859
|
+
|
860
|
+
</h3><div class="docstring">
|
861
|
+
<div class="discussion">
|
862
|
+
|
863
|
+
<p>Función que devuelve las kcalorias del alimento por su número de lípidos</p>
|
864
|
+
|
865
|
+
|
866
|
+
</div>
|
867
|
+
</div>
|
868
|
+
<div class="tags">
|
869
|
+
|
870
|
+
|
871
|
+
</div><table class="source_code">
|
872
|
+
<tr>
|
873
|
+
<td>
|
874
|
+
<pre class="lines">
|
875
|
+
|
876
|
+
|
877
|
+
45
|
878
|
+
46
|
879
|
+
47
|
880
|
+
48</pre>
|
881
|
+
</td>
|
882
|
+
<td>
|
883
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 45</span>
|
884
|
+
|
885
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format_lipids'>format_lipids</span>
|
886
|
+
<span class='id identifier rubyid_lipids_kcal'>lipids_kcal</span> <span class='op'>=</span> <span class='ivar'>@lipids</span> <span class='op'>*</span> <span class='int'>9</span>
|
887
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_lipids_kcal'>lipids_kcal</span>
|
888
|
+
<span class='kw'>end</span></pre>
|
889
|
+
</td>
|
890
|
+
</tr>
|
891
|
+
</table>
|
892
|
+
</div>
|
893
|
+
|
894
|
+
<div class="method_details ">
|
895
|
+
<h3 class="signature " id="format_proteins-instance_method">
|
896
|
+
|
897
|
+
#<strong>format_proteins</strong> ⇒ <tt>Object</tt>
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
|
902
|
+
|
903
|
+
</h3><div class="docstring">
|
904
|
+
<div class="discussion">
|
905
|
+
|
906
|
+
<p>Función que devuelve las kcalorias del alimento por su número de proteinas</p>
|
907
|
+
|
908
|
+
|
909
|
+
</div>
|
910
|
+
</div>
|
911
|
+
<div class="tags">
|
912
|
+
|
913
|
+
|
914
|
+
</div><table class="source_code">
|
915
|
+
<tr>
|
916
|
+
<td>
|
917
|
+
<pre class="lines">
|
918
|
+
|
919
|
+
|
920
|
+
33
|
921
|
+
34
|
922
|
+
35
|
923
|
+
36</pre>
|
924
|
+
</td>
|
925
|
+
<td>
|
926
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 33</span>
|
927
|
+
|
928
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format_proteins'>format_proteins</span>
|
929
|
+
<span class='id identifier rubyid_proteins_kcal'>proteins_kcal</span> <span class='op'>=</span> <span class='ivar'>@proteins</span> <span class='op'>*</span> <span class='int'>4</span>
|
930
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_proteins_kcal'>proteins_kcal</span>
|
931
|
+
<span class='kw'>end</span></pre>
|
932
|
+
</td>
|
933
|
+
</tr>
|
934
|
+
</table>
|
935
|
+
</div>
|
936
|
+
|
937
|
+
<div class="method_details ">
|
938
|
+
<h3 class="signature " id="show_ev-instance_method">
|
939
|
+
|
940
|
+
#<strong>show_ev</strong> ⇒ <tt>Object</tt>
|
941
|
+
|
942
|
+
|
943
|
+
|
944
|
+
|
945
|
+
|
946
|
+
</h3><div class="docstring">
|
947
|
+
<div class="discussion">
|
948
|
+
|
949
|
+
<p>Metodo que convierte a string los componentes del alimento en kcaloría y su
|
950
|
+
valor energético total</p>
|
951
|
+
|
952
|
+
|
953
|
+
</div>
|
954
|
+
</div>
|
955
|
+
<div class="tags">
|
956
|
+
|
957
|
+
|
958
|
+
</div><table class="source_code">
|
959
|
+
<tr>
|
960
|
+
<td>
|
961
|
+
<pre class="lines">
|
962
|
+
|
963
|
+
|
964
|
+
60
|
965
|
+
61
|
966
|
+
62</pre>
|
967
|
+
</td>
|
968
|
+
<td>
|
969
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 60</span>
|
970
|
+
|
971
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_show_ev'>show_ev</span>
|
972
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The fortmated values are: p-></span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_format_proteins'>format_proteins</span><span class='embexpr_end'>}</span><span class='tstring_content'>, c-></span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_format_ch'>format_ch</span><span class='embexpr_end'>}</span><span class='tstring_content'>, l-></span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_format_lipids'>format_lipids</span><span class='embexpr_end'>}</span><span class='tstring_content'>; The energ. value is -> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_val_energ'>val_energ</span><span class='embexpr_end'>}</span><span class='tstring_content'> kcal</span><span class='tstring_end'>"</span></span>
|
973
|
+
<span class='kw'>end</span></pre>
|
974
|
+
</td>
|
975
|
+
</tr>
|
976
|
+
</table>
|
977
|
+
</div>
|
978
|
+
|
979
|
+
<div class="method_details ">
|
980
|
+
<h3 class="signature " id="to_s-instance_method">
|
981
|
+
|
982
|
+
#<strong>to_s</strong> ⇒ <tt>Object</tt>
|
983
|
+
|
984
|
+
|
985
|
+
|
986
|
+
|
987
|
+
|
988
|
+
</h3><div class="docstring">
|
989
|
+
<div class="discussion">
|
990
|
+
|
991
|
+
<p>Función to_string</p>
|
992
|
+
|
993
|
+
|
994
|
+
</div>
|
995
|
+
</div>
|
996
|
+
<div class="tags">
|
997
|
+
|
998
|
+
|
999
|
+
</div><table class="source_code">
|
1000
|
+
<tr>
|
1001
|
+
<td>
|
1002
|
+
<pre class="lines">
|
1003
|
+
|
1004
|
+
|
1005
|
+
26
|
1006
|
+
27
|
1007
|
+
28</pre>
|
1008
|
+
</td>
|
1009
|
+
<td>
|
1010
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 26</span>
|
1011
|
+
|
1012
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
1013
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>p: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@proteins</span><span class='embexpr_end'>}</span><span class='tstring_content'>, c: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@carbohydrates</span><span class='embexpr_end'>}</span><span class='tstring_content'>, l: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@lipids</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1014
|
+
<span class='kw'>end</span></pre>
|
1015
|
+
</td>
|
1016
|
+
</tr>
|
1017
|
+
</table>
|
1018
|
+
</div>
|
1019
|
+
|
1020
|
+
<div class="method_details ">
|
1021
|
+
<h3 class="signature " id="val_energ-instance_method">
|
1022
|
+
|
1023
|
+
#<strong>val_energ</strong> ⇒ <tt>Object</tt>
|
1024
|
+
|
1025
|
+
|
1026
|
+
|
1027
|
+
|
1028
|
+
|
1029
|
+
</h3><div class="docstring">
|
1030
|
+
<div class="discussion">
|
1031
|
+
|
1032
|
+
<p>Función que devuelve las kcalorias totales del alimento</p>
|
1033
|
+
|
1034
|
+
|
1035
|
+
</div>
|
1036
|
+
</div>
|
1037
|
+
<div class="tags">
|
1038
|
+
|
1039
|
+
|
1040
|
+
</div><table class="source_code">
|
1041
|
+
<tr>
|
1042
|
+
<td>
|
1043
|
+
<pre class="lines">
|
1044
|
+
|
1045
|
+
|
1046
|
+
51
|
1047
|
+
52
|
1048
|
+
53
|
1049
|
+
54</pre>
|
1050
|
+
</td>
|
1051
|
+
<td>
|
1052
|
+
<pre class="code"><span class="info file"># File 'lib/Alimento/Comida.rb', line 51</span>
|
1053
|
+
|
1054
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_val_energ'>val_energ</span>
|
1055
|
+
<span class='ivar'>@energ_val</span> <span class='op'>=</span> <span class='id identifier rubyid_format_proteins'>format_proteins</span> <span class='op'>+</span> <span class='id identifier rubyid_format_ch'>format_ch</span> <span class='op'>+</span> <span class='id identifier rubyid_format_lipids'>format_lipids</span>
|
1056
|
+
<span class='kw'>return</span> <span class='ivar'>@energ_val</span>
|
1057
|
+
<span class='kw'>end</span></pre>
|
1058
|
+
</td>
|
1059
|
+
</tr>
|
1060
|
+
</table>
|
1061
|
+
</div>
|
1062
|
+
|
1063
|
+
</div>
|
1064
|
+
|
1065
|
+
</div>
|
1066
|
+
|
1067
|
+
<div id="footer">
|
1068
|
+
Generated on Wed Nov 15 11:43:17 2017 by
|
1069
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1070
|
+
0.9.9 (ruby-2.3.1).
|
1071
|
+
</div>
|
1072
|
+
|
1073
|
+
</div>
|
1074
|
+
</body>
|
1075
|
+
</html>
|