comida 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/.comida.gemspec.swo +0 -0
- data/.comida.gemspec.swp +0 -0
- data/.coveralls.yml +2 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +95 -0
- data/Guardfile +82 -0
- data/README.md +52 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/comida.gemspec +38 -0
- data/docs/Comida/Comida.html +463 -0
- data/docs/Comida/Error.html +105 -0
- data/docs/Comida/Lista.html +627 -0
- data/docs/Comida/Plato.html +444 -0
- data/docs/Comida/PlatoHija.html +450 -0
- data/docs/Comida.html +228 -0
- data/docs/Gemfile.html +98 -0
- data/docs/Gemfile_lock.html +177 -0
- data/docs/Guardfile.html +165 -0
- data/docs/README_md.html +146 -0
- data/docs/Rakefile.html +100 -0
- data/docs/bin/setup.html +100 -0
- data/docs/comida_gemspec.html +132 -0
- data/docs/created.rid +16 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +590 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +115 -0
- data/docs/js/darkfish.js +161 -0
- data/docs/js/jquery.js +4 -0
- data/docs/js/navigation.js +141 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +109 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +294 -0
- data/lib/comida/food.rb +99 -0
- data/lib/comida/lista.rb +167 -0
- data/lib/comida/menu.rb +79 -0
- data/lib/comida/palto_bloque.rb +59 -0
- data/lib/comida/plato.rb +233 -0
- data/lib/comida/version.rb +4 -0
- data/lib/comida.rb +12 -0
- metadata +220 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a7d7b99bf47170a80cb074f152d8dc75673f27eb79c25bf9d6616294d82a44b9
|
4
|
+
data.tar.gz: 66910b87571151e68fc79b8a07349f57659dc4cc0ed9441d77c0a0e4c0f042c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c7c0412b9f4699cc564cf718fa2d13cb3ab93fe0158a228a8b7e6f8e55aa2b4e3e1a77c3fd20be278fa87bc373aaba1138e751ef75bb53b5d476d5cd4acf22ef
|
7
|
+
data.tar.gz: fb3593b99e7a8235a1f8364129897647313251a24c11c1eb5d7463d89633bd29519b7653109f064e1275c35d8c5b981cd15f9d31300603d73ec2733e4c795a78
|
data/.comida.gemspec.swo
ADDED
Binary file
|
data/.comida.gemspec.swp
ADDED
Binary file
|
data/.coveralls.yml
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
comida (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
|
+
comida!
|
87
|
+
coveralls
|
88
|
+
guard
|
89
|
+
guard-bundler
|
90
|
+
guard-rspec
|
91
|
+
rake (~> 10.0)
|
92
|
+
rspec (~> 3.0)
|
93
|
+
|
94
|
+
BUNDLED WITH
|
95
|
+
2.0.2
|
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.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
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
Universidad de La Laguna
|
2
|
+
Escuela Superior de Ingeniería y Tecnología
|
3
|
+
Grado en Ingeniería Informática
|
4
|
+
Asignatura: Lenguajes y Paradigmas de la Programación (LPP)
|
5
|
+
Curso: 3º
|
6
|
+
Práctica 6 LPP - Desarrollo Dirigido por Pruebas (TDD)
|
7
|
+
Autor: Christian Torres GOnzalez
|
8
|
+
Correo: alu0101137902@ull.es
|
9
|
+
Fecha: 24/10/2019
|
10
|
+
|
11
|
+
----------------------------------------------------------------------------------------------
|
12
|
+
----------------------------------------------------------------------------------------------
|
13
|
+
|
14
|
+
|
15
|
+
# Comida
|
16
|
+
|
17
|
+
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/comida`. To experiment with that code, run `bin/console` for an interactive prompt.
|
18
|
+
|
19
|
+
TODO: Delete this and the text above, and describe your gem
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
Add this line to your application's Gemfile:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
gem 'comida'
|
27
|
+
```
|
28
|
+
|
29
|
+
And then execute:
|
30
|
+
|
31
|
+
$ bundle
|
32
|
+
|
33
|
+
Or install it yourself as:
|
34
|
+
|
35
|
+
$ gem install comida
|
36
|
+
|
37
|
+
## Usage
|
38
|
+
|
39
|
+
TODO: Write usage instructions here
|
40
|
+
|
41
|
+
## Development
|
42
|
+
|
43
|
+
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.
|
44
|
+
|
45
|
+
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).
|
46
|
+
|
47
|
+
## Contributing
|
48
|
+
|
49
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/comida.
|
50
|
+
|
51
|
+
|
52
|
+
https://coveralls.io/repos/github/ChristianTorresGonzalez/LPP-p10/badge.svg?branch=master(Coverage Status)!:https://coveralls.io/github/ChristianTorresGonzalez/LPP-p10?branch=master
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "comida"
|
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
data/comida.gemspec
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "comida/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "comida"
|
7
|
+
spec.version = Comida::VERSION
|
8
|
+
spec.authors = ["Christian Torres Gonzalez"]
|
9
|
+
spec.email = ["christiantorres8952@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Calculo de dieta adecuada y equilibrada.}
|
12
|
+
spec.description = %q{Calculo de dieta adecuada y nutricionalmente equilibrada que contamine lo menos posible y que afecte lo menos posible al efecto invernadero.}
|
13
|
+
spec.homepage = "https://github.com/ULL-ESIT-LPP-1920/tdd-ChristianTorresGonzalez.git"
|
14
|
+
|
15
|
+
# spec.metadata["allowed_push_host"] = "http://mygemserver.com"
|
16
|
+
|
17
|
+
# spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
#spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
19
|
+
#spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
end
|
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", "~> 2.0"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
33
|
+
spec.add_development_dependency "guard"
|
34
|
+
spec.add_development_dependency "guard-rspec"
|
35
|
+
spec.add_development_dependency "guard-bundler"
|
36
|
+
|
37
|
+
spec.add_development_dependency "coveralls"
|
38
|
+
end
|
@@ -0,0 +1,463 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Comida::Comida - 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">Object
|
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">#<=></a>
|
89
|
+
|
90
|
+
<li ><a href="#method-i-calculo_valor_energetico">#calculo_valor_energetico</a>
|
91
|
+
|
92
|
+
<li ><a href="#method-i-impacto_ambiental_hombre">#impacto_ambiental_hombre</a>
|
93
|
+
|
94
|
+
<li ><a href="#method-i-impacto_ambiental_mujer">#impacto_ambiental_mujer</a>
|
95
|
+
|
96
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
97
|
+
|
98
|
+
</ul>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
</nav>
|
103
|
+
|
104
|
+
<main role="main" aria-labelledby="class-Comida::Comida">
|
105
|
+
<h1 id="class-Comida::Comida" class="class">
|
106
|
+
class Comida::Comida
|
107
|
+
</h1>
|
108
|
+
|
109
|
+
<section class="description">
|
110
|
+
|
111
|
+
<p>Clase utilizada para almacenar los atributos como nombre, proteinas,carbohidratos, lipidos, gei, terreno de los que esta formado cada alimento</p>
|
112
|
+
|
113
|
+
</section>
|
114
|
+
|
115
|
+
|
116
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<section class="attribute-method-details" class="method-section">
|
125
|
+
<header>
|
126
|
+
<h3>Attributes</h3>
|
127
|
+
</header>
|
128
|
+
|
129
|
+
|
130
|
+
<div id="attribute-i-carbohidratos" class="method-detail">
|
131
|
+
<div class="method-heading attribute-method-heading">
|
132
|
+
<span class="method-name">carbohidratos</span><span
|
133
|
+
class="attribute-access-type">[R]</span>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<div class="method-description">
|
137
|
+
|
138
|
+
<p>Atributo utilizado para almacenar el nombre del alimento, Atributo utilizado para almacenar las proteinas del alimento, Atributo utilizado para almacenar los carbohidratos del alimento, Atributo utilizado para almacenar los lipidos del alimento, Atributo utilizado para almacenar el valor de gases de efecto invernadero Atributo utilizado para almacenar el valor del terreno del alimento</p>
|
139
|
+
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<div id="attribute-i-gei" class="method-detail">
|
144
|
+
<div class="method-heading attribute-method-heading">
|
145
|
+
<span class="method-name">gei</span><span
|
146
|
+
class="attribute-access-type">[R]</span>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div class="method-description">
|
150
|
+
|
151
|
+
<p>Atributo utilizado para almacenar el nombre del alimento, Atributo utilizado para almacenar las proteinas del alimento, Atributo utilizado para almacenar los carbohidratos del alimento, Atributo utilizado para almacenar los lipidos del alimento, Atributo utilizado para almacenar el valor de gases de efecto invernadero Atributo utilizado para almacenar el valor del terreno del alimento</p>
|
152
|
+
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div id="attribute-i-lipidos" class="method-detail">
|
157
|
+
<div class="method-heading attribute-method-heading">
|
158
|
+
<span class="method-name">lipidos</span><span
|
159
|
+
class="attribute-access-type">[R]</span>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div class="method-description">
|
163
|
+
|
164
|
+
<p>Atributo utilizado para almacenar el nombre del alimento, Atributo utilizado para almacenar las proteinas del alimento, Atributo utilizado para almacenar los carbohidratos del alimento, Atributo utilizado para almacenar los lipidos del alimento, Atributo utilizado para almacenar el valor de gases de efecto invernadero Atributo utilizado para almacenar el valor del terreno del alimento</p>
|
165
|
+
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div id="attribute-i-nombre" class="method-detail">
|
170
|
+
<div class="method-heading attribute-method-heading">
|
171
|
+
<span class="method-name">nombre</span><span
|
172
|
+
class="attribute-access-type">[R]</span>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div class="method-description">
|
176
|
+
|
177
|
+
<p>Atributo utilizado para almacenar el nombre del alimento, Atributo utilizado para almacenar las proteinas del alimento, Atributo utilizado para almacenar los carbohidratos del alimento, Atributo utilizado para almacenar los lipidos del alimento, Atributo utilizado para almacenar el valor de gases de efecto invernadero Atributo utilizado para almacenar el valor del terreno del alimento</p>
|
178
|
+
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div id="attribute-i-proteinas" class="method-detail">
|
183
|
+
<div class="method-heading attribute-method-heading">
|
184
|
+
<span class="method-name">proteinas</span><span
|
185
|
+
class="attribute-access-type">[R]</span>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div class="method-description">
|
189
|
+
|
190
|
+
<p>Atributo utilizado para almacenar el nombre del alimento, Atributo utilizado para almacenar las proteinas del alimento, Atributo utilizado para almacenar los carbohidratos del alimento, Atributo utilizado para almacenar los lipidos del alimento, Atributo utilizado para almacenar el valor de gases de efecto invernadero Atributo utilizado para almacenar el valor del terreno del alimento</p>
|
191
|
+
|
192
|
+
</div>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div id="attribute-i-terreno" class="method-detail">
|
196
|
+
<div class="method-heading attribute-method-heading">
|
197
|
+
<span class="method-name">terreno</span><span
|
198
|
+
class="attribute-access-type">[R]</span>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
|
203
|
+
<p>Atributo utilizado para almacenar el nombre del alimento, Atributo utilizado para almacenar las proteinas del alimento, Atributo utilizado para almacenar los carbohidratos del alimento, Atributo utilizado para almacenar los lipidos del alimento, Atributo utilizado para almacenar el valor de gases de efecto invernadero Atributo utilizado para almacenar el valor del terreno del alimento</p>
|
204
|
+
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
|
208
|
+
</section>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
213
|
+
<header>
|
214
|
+
<h3>Public Class Methods</h3>
|
215
|
+
</header>
|
216
|
+
|
217
|
+
|
218
|
+
<div id="method-c-new" class="method-detail ">
|
219
|
+
|
220
|
+
<div class="method-heading">
|
221
|
+
<span class="method-name">new</span><span
|
222
|
+
class="method-args">(name, protein, carbo, lipido, g, t)</span>
|
223
|
+
|
224
|
+
<span class="method-click-advice">click to toggle source</span>
|
225
|
+
|
226
|
+
</div>
|
227
|
+
|
228
|
+
|
229
|
+
<div class="method-description">
|
230
|
+
|
231
|
+
<p>Meetodo encargado de asignar a cada variable el valor del argumento recibido</p>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
<div class="method-source-code" id="new-source">
|
237
|
+
<pre><span class="ruby-comment"># File lib/comida/food.rb, line 42</span>
|
238
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">protein</span>, <span class="ruby-identifier">carbo</span>, <span class="ruby-identifier">lipido</span>, <span class="ruby-identifier">g</span>, <span class="ruby-identifier">t</span>)
|
239
|
+
<span class="ruby-ivar">@nombre</span> = <span class="ruby-identifier">name</span> <span class="ruby-comment"># Atributo utilizado para almacenar el nombre del alimento</span>
|
240
|
+
<span class="ruby-ivar">@proteinas</span> = <span class="ruby-identifier">protein</span> <span class="ruby-comment"># Atributo utilizado para almacenar las proteinas del alimento</span>
|
241
|
+
<span class="ruby-ivar">@carbohidratos</span> = <span class="ruby-identifier">carbo</span> <span class="ruby-comment"># Atributo utilizado para almacenar los carbohidratos del alimento</span>
|
242
|
+
<span class="ruby-ivar">@lipidos</span> = <span class="ruby-identifier">lipido</span> <span class="ruby-comment"># Atributo utilizado para almacenar los lipidos del alimento</span>
|
243
|
+
<span class="ruby-ivar">@gei</span> = <span class="ruby-identifier">g</span> <span class="ruby-comment"># Atributo utilizado para almacenar el valor de gases de efecto invernadero</span>
|
244
|
+
<span class="ruby-ivar">@terreno</span> = <span class="ruby-identifier">t</span> <span class="ruby-comment"># Atributo utilizado para almacenar el valor del terreno del alimento</span>
|
245
|
+
<span class="ruby-keyword">end</span></pre>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
</section>
|
257
|
+
|
258
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
259
|
+
<header>
|
260
|
+
<h3>Public Instance Methods</h3>
|
261
|
+
</header>
|
262
|
+
|
263
|
+
|
264
|
+
<div id="method-i-3C-3D-3E" class="method-detail ">
|
265
|
+
|
266
|
+
<div class="method-heading">
|
267
|
+
<span class="method-name"><=></span><span
|
268
|
+
class="method-args">(other)</span>
|
269
|
+
|
270
|
+
<span class="method-click-advice">click to toggle source</span>
|
271
|
+
|
272
|
+
</div>
|
273
|
+
|
274
|
+
|
275
|
+
<div class="method-description">
|
276
|
+
|
277
|
+
<p>Metodo utilizado para comparar dos alimentos. El cual se basa en el valor energetico y las emisiones de efecto invernadero y del terrno. Utilizamos un array para la comparacion el cual va a comparar elemento a elemento</p>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<div class="method-source-code" id="3C-3D-3E-source">
|
283
|
+
<pre><span class="ruby-comment"># File lib/comida/food.rb, line 35</span>
|
284
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title"><=></span>(<span class="ruby-identifier">other</span>)
|
285
|
+
<span class="ruby-identifier">comparando</span> = [<span class="ruby-keyword">self</span>.<span class="ruby-identifier">calculo_valor_energetico</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">gei</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">terreno</span>]
|
286
|
+
<span class="ruby-identifier">comparador</span> = [<span class="ruby-identifier">other</span>.<span class="ruby-identifier">calculo_valor_energetico</span>, <span class="ruby-identifier">other</span>.<span class="ruby-identifier">gei</span>, <span class="ruby-identifier">other</span>.<span class="ruby-identifier">terreno</span>]
|
287
|
+
<span class="ruby-identifier">comparando</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">comparador</span>
|
288
|
+
<span class="ruby-keyword">end</span></pre>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
</div>
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
</div>
|
297
|
+
|
298
|
+
|
299
|
+
<div id="method-i-calculo_valor_energetico" class="method-detail ">
|
300
|
+
|
301
|
+
<div class="method-heading">
|
302
|
+
<span class="method-name">calculo_valor_energetico</span><span
|
303
|
+
class="method-args">()</span>
|
304
|
+
|
305
|
+
<span class="method-click-advice">click to toggle source</span>
|
306
|
+
|
307
|
+
</div>
|
308
|
+
|
309
|
+
|
310
|
+
<div class="method-description">
|
311
|
+
|
312
|
+
<p>Funcion utilizada para el calculo del valor energetico, el cual consiste simplemente en multiplicar las proteinas, lipidos y carbohidratos por su respectivo indice</p>
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
<div class="method-source-code" id="calculo_valor_energetico-source">
|
318
|
+
<pre><span class="ruby-comment"># File lib/comida/food.rb, line 59</span>
|
319
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">calculo_valor_energetico</span>
|
320
|
+
(<span class="ruby-ivar">@carbohidratos</span><span class="ruby-operator">*</span><span class="ruby-value">4</span>) <span class="ruby-operator">+</span> (<span class="ruby-ivar">@lipidos</span><span class="ruby-operator">*</span><span class="ruby-value">9</span>) <span class="ruby-operator">+</span> (<span class="ruby-ivar">@proteinas</span><span class="ruby-operator">*</span><span class="ruby-value">4</span>)
|
321
|
+
<span class="ruby-keyword">end</span></pre>
|
322
|
+
</div>
|
323
|
+
|
324
|
+
</div>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</div>
|
330
|
+
|
331
|
+
|
332
|
+
<div id="method-i-impacto_ambiental_hombre" class="method-detail ">
|
333
|
+
|
334
|
+
<div class="method-heading">
|
335
|
+
<span class="method-name">impacto_ambiental_hombre</span><span
|
336
|
+
class="method-args">(value)</span>
|
337
|
+
|
338
|
+
<span class="method-click-advice">click to toggle source</span>
|
339
|
+
|
340
|
+
</div>
|
341
|
+
|
342
|
+
|
343
|
+
<div class="method-description">
|
344
|
+
|
345
|
+
<p>Metodo utilizado para calcular el impacto ambiental del hombre. Para ello se utiliza el valor de los gases de efecto invernadero y del terreno. Al ser un array de alimentos, es por ello que recorremos todo el array y sumamos cada valor de gei y terreno de almento. Esta es la funcion utilizada para el hombre</p>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
<div class="method-source-code" id="impacto_ambiental_hombre-source">
|
351
|
+
<pre><span class="ruby-comment"># File lib/comida/food.rb, line 67</span>
|
352
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">impacto_ambiental_hombre</span>(<span class="ruby-identifier">value</span>)
|
353
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
354
|
+
<span class="ruby-identifier">impacto_ambiental</span> = <span class="ruby-value">0.0</span>
|
355
|
+
<span class="ruby-identifier">impacto_terreno</span> = <span class="ruby-value">0.0</span>
|
356
|
+
|
357
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">i</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">length</span>
|
358
|
+
<span class="ruby-identifier">impacto_ambiental</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">value</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">gei</span>
|
359
|
+
<span class="ruby-identifier">impacto_terreno</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">value</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">terreno</span>
|
360
|
+
<span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
361
|
+
<span class="ruby-keyword">end</span>
|
362
|
+
|
363
|
+
<span class="ruby-identifier">salida</span> = [<span class="ruby-identifier">impacto_ambiental</span>, <span class="ruby-identifier">impacto_terreno</span>]
|
364
|
+
<span class="ruby-keyword">end</span></pre>
|
365
|
+
</div>
|
366
|
+
|
367
|
+
</div>
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
</div>
|
373
|
+
|
374
|
+
|
375
|
+
<div id="method-i-impacto_ambiental_mujer" class="method-detail ">
|
376
|
+
|
377
|
+
<div class="method-heading">
|
378
|
+
<span class="method-name">impacto_ambiental_mujer</span><span
|
379
|
+
class="method-args">(value)</span>
|
380
|
+
|
381
|
+
<span class="method-click-advice">click to toggle source</span>
|
382
|
+
|
383
|
+
</div>
|
384
|
+
|
385
|
+
|
386
|
+
<div class="method-description">
|
387
|
+
|
388
|
+
<p>Metodo utilizado para calcular el impacto ambiental del hombre. Para ello se utiliza el valor de los gases de efecto invernadero y del terreno. Al ser un array de alimentos, es por ello que recorremos todo el array y sumamos cada valor de gei y terreno de almento. Esta es la funcion utilizada para el hombre</p>
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
<div class="method-source-code" id="impacto_ambiental_mujer-source">
|
394
|
+
<pre><span class="ruby-comment"># File lib/comida/food.rb, line 85</span>
|
395
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">impacto_ambiental_mujer</span>(<span class="ruby-identifier">value</span>)
|
396
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
397
|
+
<span class="ruby-identifier">impacto_ambiental</span> = <span class="ruby-value">0.0</span>
|
398
|
+
<span class="ruby-identifier">impacto_terreno</span> = <span class="ruby-value">0.0</span>
|
399
|
+
|
400
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">i</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">length</span>
|
401
|
+
<span class="ruby-identifier">impacto_ambiental</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">value</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">gei</span>
|
402
|
+
<span class="ruby-identifier">impacto_terreno</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">value</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">terreno</span>
|
403
|
+
<span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
404
|
+
<span class="ruby-keyword">end</span>
|
405
|
+
|
406
|
+
<span class="ruby-identifier">salida</span> = [<span class="ruby-identifier">impacto_ambiental</span>, <span class="ruby-identifier">impacto_terreno</span>]
|
407
|
+
<span class="ruby-keyword">end</span></pre>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
</div>
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
</div>
|
416
|
+
|
417
|
+
|
418
|
+
<div id="method-i-to_s" class="method-detail ">
|
419
|
+
|
420
|
+
<div class="method-heading">
|
421
|
+
<span class="method-name">to_s</span><span
|
422
|
+
class="method-args">()</span>
|
423
|
+
|
424
|
+
<span class="method-click-advice">click to toggle source</span>
|
425
|
+
|
426
|
+
</div>
|
427
|
+
|
428
|
+
|
429
|
+
<div class="method-description">
|
430
|
+
|
431
|
+
<p>Metodo utilizado para formatear la salida de las variables de un alimento. Es decir mostrarlo en formato string con los valores de cada atributo</p>
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
<div class="method-source-code" id="to_s-source">
|
437
|
+
<pre><span class="ruby-comment"># File lib/comida/food.rb, line 53</span>
|
438
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
|
439
|
+
<span class="ruby-node">"(#{@nombre}, #{@proteinas}, #{@carbohidratos}, #{@lipidos}, #{@gei}, #{@terreno})"</span>
|
440
|
+
<span class="ruby-keyword">end</span></pre>
|
441
|
+
</div>
|
442
|
+
|
443
|
+
</div>
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
</div>
|
449
|
+
|
450
|
+
|
451
|
+
</section>
|
452
|
+
|
453
|
+
</section>
|
454
|
+
|
455
|
+
</main>
|
456
|
+
|
457
|
+
|
458
|
+
<footer id="validator-badges" role="contentinfo">
|
459
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
460
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
461
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
462
|
+
</footer>
|
463
|
+
|