alimentohv 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 +11 -0
- data/.rake_tasks~ +7 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/Guardfile +82 -0
- data/README.md +3 -0
- data/Rakefile +6 -0
- data/alimento.gemspec +39 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/Alimento.html +109 -0
- data/doc/Alimentos.html +467 -0
- data/doc/Gemfile.html +99 -0
- data/doc/Gemfile_lock.html +176 -0
- data/doc/Grupo.html +383 -0
- data/doc/Grupo_bebidas.html +102 -0
- data/doc/Grupo_carbohidratos.html +102 -0
- data/doc/Grupo_carnes.html +102 -0
- data/doc/Grupo_frutas.html +102 -0
- data/doc/Grupo_grasos.html +102 -0
- data/doc/Grupo_lacteos.html +102 -0
- data/doc/Grupo_pescados.html +102 -0
- data/doc/Grupo_verduras.html +102 -0
- data/doc/Guardfile.html +176 -0
- data/doc/Lista.html +457 -0
- data/doc/Object.html +116 -0
- data/doc/README_md.html +96 -0
- data/doc/Rakefile.html +97 -0
- data/doc/alimento_gemspec.html +130 -0
- data/doc/bin/setup.html +97 -0
- data/doc/created.rid +16 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +590 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +125 -0
- data/doc/js/darkfish.js +161 -0
- data/doc/js/jquery.js +4 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +228 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +214 -0
- data/docs/Alimento.html +109 -0
- data/docs/Alimentos.html +467 -0
- data/docs/Gemfile.html +99 -0
- data/docs/Gemfile_lock.html +176 -0
- data/docs/Grupo.html +383 -0
- data/docs/Grupo_bebidas.html +102 -0
- data/docs/Grupo_carbohidratos.html +102 -0
- data/docs/Grupo_carnes.html +102 -0
- data/docs/Grupo_frutas.html +102 -0
- data/docs/Grupo_grasos.html +102 -0
- data/docs/Grupo_lacteos.html +102 -0
- data/docs/Grupo_pescados.html +102 -0
- data/docs/Grupo_verduras.html +102 -0
- data/docs/Guardfile.html +176 -0
- data/docs/Lista.html +457 -0
- data/docs/Object.html +116 -0
- data/docs/README_md.html +96 -0
- data/docs/Rakefile.html +97 -0
- data/docs/alimento_gemspec.html +130 -0
- data/docs/bin/setup.html +97 -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 +125 -0
- data/docs/js/darkfish.js +161 -0
- data/docs/js/jquery.js +4 -0
- data/docs/js/navigation.js +142 -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 +228 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +214 -0
- data/lib/alimento.rb +13 -0
- data/lib/alimento/alimentos.rb +35 -0
- data/lib/alimento/calculadora.rb +55 -0
- data/lib/alimento/comida.rb +58 -0
- data/lib/alimento/grupo.rb +53 -0
- data/lib/alimento/individuo.rb +46 -0
- data/lib/alimento/lista.rb +65 -0
- data/lib/alimento/platohardvard.rb +160 -0
- data/lib/alimento/version.rb +3 -0
- metadata +292 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 759b1b0faae8cf3ee62e50794436c9d7de383981
|
|
4
|
+
data.tar.gz: d7c3f1b8cbfc2c9a1a08b85a04ab58e9d6ec8e80
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 361f4be5b4b298248c4d5f7575cbcc619dce9a28637edcba020b6bbad016c1c0f3975b19616eccb8d7f594800dfc6d7f041774d195fc49f4404fbd4b766c93d2
|
|
7
|
+
data.tar.gz: 5a1cbc2347560e148cf9fa239b914f896681dd3eea8456dfe1a5d712dfc5846fae247889086dbd71f873921e52735cf8341f27cdaf7ee600c1590304cc3f553a
|
data/.coveralls.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
data/.rake_tasks~
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
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/README.md
ADDED
data/Rakefile
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 = "alimentohv"
|
|
8
|
+
spec.version = Alimento::VERSION
|
|
9
|
+
spec.authors = ["Joram Real Gómez"]
|
|
10
|
+
spec.email = ["alu0100226300@ull.edu.es"]
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{sumario de la gema}
|
|
13
|
+
spec.description = %q{sumario de la gema}
|
|
14
|
+
spec.homepage = "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100226300.git"
|
|
15
|
+
|
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
17
|
+
=begin # to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
18
|
+
if spec.respond_to?(:metadata)
|
|
19
|
+
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
|
20
|
+
else
|
|
21
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
|
22
|
+
"public gem pushes."
|
|
23
|
+
=end end
|
|
24
|
+
|
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
26
|
+
f.match(%r{^(test|spec|features)/})
|
|
27
|
+
end
|
|
28
|
+
spec.bindir = "exe"
|
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
30
|
+
spec.require_paths = ["lib"]
|
|
31
|
+
|
|
32
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
|
33
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
34
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
35
|
+
spec.add_development_dependency "guard"
|
|
36
|
+
spec.add_development_dependency "guard-rspec"
|
|
37
|
+
spec.add_development_dependency "guard-bundler"
|
|
38
|
+
spec.add_development_dependency "coveralls"
|
|
39
|
+
end
|
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(__FILE__)
|
data/bin/setup
ADDED
data/doc/Alimento.html
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>module Alimento - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "./";
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script src="./js/jquery.js"></script>
|
|
14
|
+
<script src="./js/darkfish.js"></script>
|
|
15
|
+
|
|
16
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
|
17
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<body id="top" role="document" class="module">
|
|
22
|
+
<nav role="navigation">
|
|
23
|
+
<div id="project-navigation">
|
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
25
|
+
<h2>
|
|
26
|
+
<a href="./index.html" rel="home">Home</a>
|
|
27
|
+
</h2>
|
|
28
|
+
|
|
29
|
+
<div id="table-of-contents-navigation">
|
|
30
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
|
31
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
|
32
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
38
|
+
<div id="search-field-wrapper">
|
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
|
46
|
+
aria-busy="false" aria-expanded="false"
|
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
48
|
+
</form>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<div id="class-metadata">
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
</div>
|
|
62
|
+
</nav>
|
|
63
|
+
|
|
64
|
+
<main role="main" aria-labelledby="module-Alimento">
|
|
65
|
+
<h1 id="module-Alimento" class="module">
|
|
66
|
+
module Alimento
|
|
67
|
+
</h1>
|
|
68
|
+
|
|
69
|
+
<section class="description">
|
|
70
|
+
|
|
71
|
+
</section>
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
<section class="constants-list">
|
|
83
|
+
<header>
|
|
84
|
+
<h3>Constants</h3>
|
|
85
|
+
</header>
|
|
86
|
+
<dl>
|
|
87
|
+
|
|
88
|
+
<dt id="VERSION">VERSION
|
|
89
|
+
|
|
90
|
+
<dd>
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</dl>
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
</section>
|
|
101
|
+
</main>
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<footer id="validator-badges" role="contentinfo">
|
|
105
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
106
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
|
|
107
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
108
|
+
</footer>
|
|
109
|
+
|
data/doc/Alimentos.html
ADDED
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class Alimentos - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "./";
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script src="./js/jquery.js"></script>
|
|
14
|
+
<script src="./js/darkfish.js"></script>
|
|
15
|
+
|
|
16
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
|
17
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<body id="top" role="document" class="class">
|
|
22
|
+
<nav role="navigation">
|
|
23
|
+
<div id="project-navigation">
|
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
25
|
+
<h2>
|
|
26
|
+
<a href="./index.html" rel="home">Home</a>
|
|
27
|
+
</h2>
|
|
28
|
+
|
|
29
|
+
<div id="table-of-contents-navigation">
|
|
30
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
|
31
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
|
32
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
38
|
+
<div id="search-field-wrapper">
|
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
|
46
|
+
aria-busy="false" aria-expanded="false"
|
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
48
|
+
</form>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<div id="class-metadata">
|
|
56
|
+
|
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
|
58
|
+
<h3>Parent</h3>
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<p class="link"><a href="Object.html">Object</a>
|
|
62
|
+
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<!-- Method Quickref -->
|
|
68
|
+
<div id="method-list-section" class="nav-section">
|
|
69
|
+
<h3>Methods</h3>
|
|
70
|
+
|
|
71
|
+
<ul class="link-list" role="directory">
|
|
72
|
+
|
|
73
|
+
<li ><a href="#method-c-new">::new</a>
|
|
74
|
+
|
|
75
|
+
<li ><a href="#method-i-3D-3D">#==</a>
|
|
76
|
+
|
|
77
|
+
<li ><a href="#method-i-get_energetico">#get_energetico</a>
|
|
78
|
+
|
|
79
|
+
<li ><a href="#method-i-get_glucidos">#get_glucidos</a>
|
|
80
|
+
|
|
81
|
+
<li ><a href="#method-i-get_lipidos">#get_lipidos</a>
|
|
82
|
+
|
|
83
|
+
<li ><a href="#method-i-get_nombre">#get_nombre</a>
|
|
84
|
+
|
|
85
|
+
<li ><a href="#method-i-get_proteinas">#get_proteinas</a>
|
|
86
|
+
|
|
87
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
|
88
|
+
|
|
89
|
+
</ul>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
</div>
|
|
93
|
+
</nav>
|
|
94
|
+
|
|
95
|
+
<main role="main" aria-labelledby="class-Alimentos">
|
|
96
|
+
<h1 id="class-Alimentos" class="class">
|
|
97
|
+
class Alimentos
|
|
98
|
+
</h1>
|
|
99
|
+
|
|
100
|
+
<section class="description">
|
|
101
|
+
|
|
102
|
+
</section>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<section class="attribute-method-details" class="method-section">
|
|
116
|
+
<header>
|
|
117
|
+
<h3>Attributes</h3>
|
|
118
|
+
</header>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
<div id="attribute-i-glucidos" class="method-detail">
|
|
122
|
+
<div class="method-heading attribute-method-heading">
|
|
123
|
+
<span class="method-name">glucidos</span><span
|
|
124
|
+
class="attribute-access-type">[R]</span>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div class="method-description">
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div id="attribute-i-lipidos" class="method-detail">
|
|
135
|
+
<div class="method-heading attribute-method-heading">
|
|
136
|
+
<span class="method-name">lipidos</span><span
|
|
137
|
+
class="attribute-access-type">[R]</span>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div class="method-description">
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div id="attribute-i-nombre" class="method-detail">
|
|
148
|
+
<div class="method-heading attribute-method-heading">
|
|
149
|
+
<span class="method-name">nombre</span><span
|
|
150
|
+
class="attribute-access-type">[R]</span>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<div class="method-description">
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div id="attribute-i-proteinas" class="method-detail">
|
|
161
|
+
<div class="method-heading attribute-method-heading">
|
|
162
|
+
<span class="method-name">proteinas</span><span
|
|
163
|
+
class="attribute-access-type">[R]</span>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div class="method-description">
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
</section>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
178
|
+
<header>
|
|
179
|
+
<h3>Public Class Methods</h3>
|
|
180
|
+
</header>
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
<div id="method-c-new" class="method-detail ">
|
|
184
|
+
|
|
185
|
+
<div class="method-heading">
|
|
186
|
+
<span class="method-name">new</span><span
|
|
187
|
+
class="method-args">(nombre, proteinas, glucidos, lipidos)</span>
|
|
188
|
+
|
|
189
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
190
|
+
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
<div class="method-description">
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
<div class="method-source-code" id="new-source">
|
|
202
|
+
<pre><span class="ruby-comment"># File lib/alimento/alimentos.rb, line 3</span>
|
|
203
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">proteinas</span>, <span class="ruby-identifier">glucidos</span>, <span class="ruby-identifier">lipidos</span>
|
|
204
|
+
<span class="ruby-ivar">@nombre</span>, <span class="ruby-ivar">@proteinas</span>, <span class="ruby-ivar">@glucidos</span>, <span class="ruby-ivar">@lipidos</span> = <span class="ruby-identifier">nombre</span>, <span class="ruby-identifier">proteinas</span>, <span class="ruby-identifier">glucidos</span>, <span class="ruby-identifier">lipidos</span>
|
|
205
|
+
<span class="ruby-keyword">end</span></pre>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
</section>
|
|
217
|
+
|
|
218
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
219
|
+
<header>
|
|
220
|
+
<h3>Public Instance Methods</h3>
|
|
221
|
+
</header>
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
<div id="method-i-3D-3D" class="method-detail ">
|
|
225
|
+
|
|
226
|
+
<div class="method-heading">
|
|
227
|
+
<span class="method-name">==</span><span
|
|
228
|
+
class="method-args">(otro)</span>
|
|
229
|
+
|
|
230
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
231
|
+
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
<div class="method-description">
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
<div class="method-source-code" id="3D-3D-source">
|
|
243
|
+
<pre><span class="ruby-comment"># File lib/alimento/alimentos.rb, line 28</span>
|
|
244
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">otro</span>)
|
|
245
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">otro</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@nombre</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">otro</span>.<span class="ruby-identifier">nombre</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@proteinas</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">otro</span>.<span class="ruby-identifier">proteinas</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@glucidos</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">otro</span>.<span class="ruby-identifier">glucidos</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@lipidos</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">otro</span>.<span class="ruby-identifier">lipidos</span>
|
|
246
|
+
<span class="ruby-keyword">end</span></pre>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<div id="method-i-get_energetico" class="method-detail ">
|
|
258
|
+
|
|
259
|
+
<div class="method-heading">
|
|
260
|
+
<span class="method-name">get_energetico</span><span
|
|
261
|
+
class="method-args">()</span>
|
|
262
|
+
|
|
263
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
264
|
+
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<div class="method-description">
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
<div class="method-source-code" id="get_energetico-source">
|
|
276
|
+
<pre><span class="ruby-comment"># File lib/alimento/alimentos.rb, line 23</span>
|
|
277
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_energetico</span>
|
|
278
|
+
<span class="ruby-ivar">@aux</span> = (<span class="ruby-ivar">@glucidos</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>)
|
|
279
|
+
<span class="ruby-ivar">@aux</span>
|
|
280
|
+
<span class="ruby-keyword">end</span></pre>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
<div id="method-i-get_glucidos" class="method-detail ">
|
|
292
|
+
|
|
293
|
+
<div class="method-heading">
|
|
294
|
+
<span class="method-name">get_glucidos</span><span
|
|
295
|
+
class="method-args">()</span>
|
|
296
|
+
|
|
297
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
298
|
+
|
|
299
|
+
</div>
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
<div class="method-description">
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
<div class="method-source-code" id="get_glucidos-source">
|
|
310
|
+
<pre><span class="ruby-comment"># File lib/alimento/alimentos.rb, line 15</span>
|
|
311
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_glucidos</span>
|
|
312
|
+
<span class="ruby-ivar">@glucidos</span>
|
|
313
|
+
<span class="ruby-keyword">end</span></pre>
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
</div>
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
</div>
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
<div id="method-i-get_lipidos" class="method-detail ">
|
|
325
|
+
|
|
326
|
+
<div class="method-heading">
|
|
327
|
+
<span class="method-name">get_lipidos</span><span
|
|
328
|
+
class="method-args">()</span>
|
|
329
|
+
|
|
330
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
331
|
+
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
<div class="method-description">
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
<div class="method-source-code" id="get_lipidos-source">
|
|
343
|
+
<pre><span class="ruby-comment"># File lib/alimento/alimentos.rb, line 19</span>
|
|
344
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_lipidos</span>
|
|
345
|
+
<span class="ruby-ivar">@lipidos</span>
|
|
346
|
+
<span class="ruby-keyword">end</span></pre>
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
</div>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
<div id="method-i-get_nombre" class="method-detail ">
|
|
358
|
+
|
|
359
|
+
<div class="method-heading">
|
|
360
|
+
<span class="method-name">get_nombre</span><span
|
|
361
|
+
class="method-args">()</span>
|
|
362
|
+
|
|
363
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
364
|
+
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
<div class="method-description">
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
<div class="method-source-code" id="get_nombre-source">
|
|
376
|
+
<pre><span class="ruby-comment"># File lib/alimento/alimentos.rb, line 7</span>
|
|
377
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_nombre</span>
|
|
378
|
+
<span class="ruby-ivar">@nombre</span>
|
|
379
|
+
<span class="ruby-keyword">end</span></pre>
|
|
380
|
+
</div>
|
|
381
|
+
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
</div>
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
<div id="method-i-get_proteinas" class="method-detail ">
|
|
391
|
+
|
|
392
|
+
<div class="method-heading">
|
|
393
|
+
<span class="method-name">get_proteinas</span><span
|
|
394
|
+
class="method-args">()</span>
|
|
395
|
+
|
|
396
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
397
|
+
|
|
398
|
+
</div>
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
<div class="method-description">
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
<div class="method-source-code" id="get_proteinas-source">
|
|
409
|
+
<pre><span class="ruby-comment"># File lib/alimento/alimentos.rb, line 11</span>
|
|
410
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_proteinas</span>
|
|
411
|
+
<span class="ruby-ivar">@proteinas</span>
|
|
412
|
+
<span class="ruby-keyword">end</span></pre>
|
|
413
|
+
</div>
|
|
414
|
+
|
|
415
|
+
</div>
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
<div id="method-i-to_s" class="method-detail ">
|
|
424
|
+
|
|
425
|
+
<div class="method-heading">
|
|
426
|
+
<span class="method-name">to_s</span><span
|
|
427
|
+
class="method-args">()</span>
|
|
428
|
+
|
|
429
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
430
|
+
|
|
431
|
+
</div>
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
<div class="method-description">
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
<div class="method-source-code" id="to_s-source">
|
|
442
|
+
<pre><span class="ruby-comment"># File lib/alimento/alimentos.rb, line 32</span>
|
|
443
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
|
444
|
+
<span class="ruby-node">"#{nombre}, #{proteinas}, #{glucidos}, #{lipidos}"</span>
|
|
445
|
+
<span class="ruby-keyword">end</span></pre>
|
|
446
|
+
</div>
|
|
447
|
+
|
|
448
|
+
</div>
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
</div>
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
</section>
|
|
457
|
+
|
|
458
|
+
</section>
|
|
459
|
+
</main>
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
<footer id="validator-badges" role="contentinfo">
|
|
463
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
464
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
|
|
465
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
466
|
+
</footer>
|
|
467
|
+
|