InformacionNutricional 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +111 -0
- data/Guardfile +82 -0
- data/InformacionNutricional.gemspec +47 -0
- data/README.md +33 -0
- data/Rakefile +16 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/Etiqueta.html +1389 -0
- data/doc/InformacionNutricional.html +133 -0
- data/doc/InformacionNutricional/Error.html +124 -0
- data/doc/List.html +1300 -0
- data/doc/Node.html +409 -0
- data/doc/Paciente.html +1849 -0
- data/doc/Persona.html +520 -0
- data/doc/_index.html +171 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +114 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +114 -0
- data/doc/js/app.js +292 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +555 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/InformacionNutricional.rb +6 -0
- data/lib/InformacionNutricional/array.rb +49 -0
- data/lib/InformacionNutricional/etiqueta.rb +54 -0
- data/lib/InformacionNutricional/list.rb +186 -0
- data/lib/InformacionNutricional/menu.rb +223 -0
- data/lib/InformacionNutricional/paciente.rb +117 -0
- data/lib/InformacionNutricional/persona.rb +32 -0
- data/lib/InformacionNutricional/version.rb +3 -0
- metadata +186 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a71cdbaa00e6c0e941c4d3a4598f541b38ee1ae915f17bf5aaae4939b98abbff
|
4
|
+
data.tar.gz: 28d9592cd886758acd1e2db854542452ce8d2bf3572d7310d4ea16bfbff7d73a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: abc29fd744ed59661b4463bf66caddb22d99bb1532f18f217c8daf3358435c7b0628a4f441999ae9ea58d8b31e943df0cdf986fff05422aed8ea9ac6ef709e75
|
7
|
+
data.tar.gz: 150153426eba43f09e2c883d5a025fbc49e546c4ecfd67f896f47bec1637edbb54040a0bf33ebc53ea3930c63fda7cffaf60cd745dc10b6f3dc1fc17ce7e0ef6
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
InformacionNutricional (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.1.2)
|
10
|
+
coveralls (0.7.1)
|
11
|
+
multi_json (~> 1.3)
|
12
|
+
rest-client
|
13
|
+
simplecov (>= 0.7)
|
14
|
+
term-ansicolor
|
15
|
+
thor
|
16
|
+
diff-lcs (1.3)
|
17
|
+
docile (1.3.1)
|
18
|
+
domain_name (0.5.20180417)
|
19
|
+
unf (>= 0.0.5, < 1.0.0)
|
20
|
+
ffi (1.9.25)
|
21
|
+
formatador (0.2.5)
|
22
|
+
guard (2.15.0)
|
23
|
+
formatador (>= 0.2.4)
|
24
|
+
listen (>= 2.7, < 4.0)
|
25
|
+
lumberjack (>= 1.0.12, < 2.0)
|
26
|
+
nenv (~> 0.1)
|
27
|
+
notiffany (~> 0.0)
|
28
|
+
pry (>= 0.9.12)
|
29
|
+
shellany (~> 0.0)
|
30
|
+
thor (>= 0.18.1)
|
31
|
+
guard-bundler (2.1.0)
|
32
|
+
bundler (~> 1.0)
|
33
|
+
guard (~> 2.2)
|
34
|
+
guard-compat (~> 1.1)
|
35
|
+
guard-compat (1.2.1)
|
36
|
+
guard-rspec (4.7.3)
|
37
|
+
guard (~> 2.1)
|
38
|
+
guard-compat (~> 1.1)
|
39
|
+
rspec (>= 2.99.0, < 4.0)
|
40
|
+
http-cookie (1.0.3)
|
41
|
+
domain_name (~> 0.5)
|
42
|
+
json (2.1.0)
|
43
|
+
listen (3.1.5)
|
44
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
45
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
46
|
+
ruby_dep (~> 1.2)
|
47
|
+
lumberjack (1.0.13)
|
48
|
+
method_source (0.9.2)
|
49
|
+
mime-types (3.2.2)
|
50
|
+
mime-types-data (~> 3.2015)
|
51
|
+
mime-types-data (3.2018.0812)
|
52
|
+
multi_json (1.13.1)
|
53
|
+
nenv (0.3.0)
|
54
|
+
netrc (0.11.0)
|
55
|
+
notiffany (0.1.1)
|
56
|
+
nenv (~> 0.1)
|
57
|
+
shellany (~> 0.0)
|
58
|
+
pry (0.12.2)
|
59
|
+
coderay (~> 1.1.0)
|
60
|
+
method_source (~> 0.9.0)
|
61
|
+
rake (10.5.0)
|
62
|
+
rb-fsevent (0.10.3)
|
63
|
+
rb-inotify (0.9.10)
|
64
|
+
ffi (>= 0.5.0, < 2)
|
65
|
+
rest-client (2.0.2)
|
66
|
+
http-cookie (>= 1.0.2, < 2.0)
|
67
|
+
mime-types (>= 1.16, < 4.0)
|
68
|
+
netrc (~> 0.8)
|
69
|
+
rspec (3.8.0)
|
70
|
+
rspec-core (~> 3.8.0)
|
71
|
+
rspec-expectations (~> 3.8.0)
|
72
|
+
rspec-mocks (~> 3.8.0)
|
73
|
+
rspec-core (3.8.0)
|
74
|
+
rspec-support (~> 3.8.0)
|
75
|
+
rspec-expectations (3.8.2)
|
76
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
77
|
+
rspec-support (~> 3.8.0)
|
78
|
+
rspec-mocks (3.8.0)
|
79
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
80
|
+
rspec-support (~> 3.8.0)
|
81
|
+
rspec-support (3.8.0)
|
82
|
+
ruby_dep (1.5.0)
|
83
|
+
shellany (0.0.1)
|
84
|
+
simplecov (0.16.1)
|
85
|
+
docile (~> 1.1)
|
86
|
+
json (>= 1.8, < 3)
|
87
|
+
simplecov-html (~> 0.10.0)
|
88
|
+
simplecov-html (0.10.2)
|
89
|
+
term-ansicolor (1.7.0)
|
90
|
+
tins (~> 1.0)
|
91
|
+
thor (0.20.3)
|
92
|
+
tins (1.20.2)
|
93
|
+
unf (0.1.4)
|
94
|
+
unf_ext
|
95
|
+
unf_ext (0.0.7.5)
|
96
|
+
|
97
|
+
PLATFORMS
|
98
|
+
ruby
|
99
|
+
|
100
|
+
DEPENDENCIES
|
101
|
+
InformacionNutricional!
|
102
|
+
bundler (~> 1.17)
|
103
|
+
coveralls
|
104
|
+
guard
|
105
|
+
guard-bundler
|
106
|
+
guard-rspec
|
107
|
+
rake (~> 10.0)
|
108
|
+
rspec (~> 3.0)
|
109
|
+
|
110
|
+
BUNDLED WITH
|
111
|
+
1.17.1
|
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
|
@@ -0,0 +1,47 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "InformacionNutricional/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "InformacionNutricional"
|
8
|
+
spec.version = InformacionNutricional::VERSION
|
9
|
+
spec.authors = ["Ana Cáceres"]
|
10
|
+
spec.email = ["alu0100972016@ull.edu.es"]
|
11
|
+
|
12
|
+
spec.summary = %q{Esto es una gema que representa la información nutricional de un alimento}
|
13
|
+
spec.description = %q{}
|
14
|
+
spec.homepage = "https://github.com/ULL-ESIT-LPP-1819/tdd-alu0100972016.git"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
|
+
# 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"] = "https://github.com"
|
20
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
21
|
+
|
22
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
+
spec.metadata["source_code_uri"] = "https://github.com/ULL-ESIT-LPP-1819/tdd-alu0100972016.git"
|
24
|
+
spec.metadata["changelog_uri"] = "https://github.com/ULL-ESIT-LPP-1819/tdd-alu0100972016.git"
|
25
|
+
else
|
26
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
27
|
+
"public gem pushes."
|
28
|
+
end
|
29
|
+
|
30
|
+
# Specify which files should be added to the gem when it is released.
|
31
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
32
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
33
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
+
end
|
35
|
+
spec.bindir = "exe"
|
36
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
|
+
spec.require_paths = ["lib"]
|
38
|
+
|
39
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
40
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
41
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
42
|
+
spec.add_development_dependency "guard"
|
43
|
+
spec.add_development_dependency "guard-rspec"
|
44
|
+
spec.add_development_dependency "guard-bundler"
|
45
|
+
spec.add_development_dependency "coveralls"
|
46
|
+
|
47
|
+
end
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# InformacionNutricional
|
2
|
+
|
3
|
+
This gem describes the nutritional information of diferent foods.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'InformacionNutricional'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install InformacionNutricional
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Display nutritional information
|
24
|
+
|
25
|
+
## Development
|
26
|
+
|
27
|
+
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.
|
28
|
+
|
29
|
+
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).
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/InformacionNutricional.
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
task :default => :spec
|
7
|
+
|
8
|
+
desc "Ejecutar las expectativas de los menus y los pacientes"
|
9
|
+
task :spec do
|
10
|
+
sh "rspec -I. spec/menu_spec.rb"
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Ejecutar con documentacion"
|
14
|
+
task :doc do
|
15
|
+
sh "rspec -I. spec/menu_spec.rb --format documentation"
|
16
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "InformacionNutricional"
|
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/Etiqueta.html
ADDED
@@ -0,0 +1,1389 @@
|
|
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: Etiqueta
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.16
|
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 = "Etiqueta";
|
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 (E)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Etiqueta</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: Etiqueta
|
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">Etiqueta</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/InformacionNutricional/etiqueta.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
108
|
+
<div class="discussion">
|
109
|
+
|
110
|
+
<p>Esta clase implementa una etiqueta que almacena el valor nutricional de
|
111
|
+
alimentos Se ha incluido el mixin Comparable</p>
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="tags">
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
124
|
+
<ul class="summary">
|
125
|
+
|
126
|
+
<li class="public ">
|
127
|
+
<span class="summary_signature">
|
128
|
+
|
129
|
+
<a href="#carbs-instance_method" title="#carbs (instance method)">#<strong>carbs</strong> ⇒ Object </a>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
</span>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
<span class="note title readonly">readonly</span>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<span class="summary_desc"><div class='inline'>
|
149
|
+
<p>Getters de las variables de instancia.</p>
|
150
|
+
</div></span>
|
151
|
+
|
152
|
+
</li>
|
153
|
+
|
154
|
+
|
155
|
+
<li class="public ">
|
156
|
+
<span class="summary_signature">
|
157
|
+
|
158
|
+
<a href="#fats-instance_method" title="#fats (instance method)">#<strong>fats</strong> ⇒ Object </a>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
</span>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<span class="note title readonly">readonly</span>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<span class="summary_desc"><div class='inline'>
|
178
|
+
<p>Getters de las variables de instancia.</p>
|
179
|
+
</div></span>
|
180
|
+
|
181
|
+
</li>
|
182
|
+
|
183
|
+
|
184
|
+
<li class="public ">
|
185
|
+
<span class="summary_signature">
|
186
|
+
|
187
|
+
<a href="#kcal-instance_method" title="#kcal (instance method)">#<strong>kcal</strong> ⇒ Object </a>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
</span>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
<span class="note title readonly">readonly</span>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<span class="summary_desc"><div class='inline'>
|
207
|
+
<p>Getters de las variables de instancia.</p>
|
208
|
+
</div></span>
|
209
|
+
|
210
|
+
</li>
|
211
|
+
|
212
|
+
|
213
|
+
<li class="public ">
|
214
|
+
<span class="summary_signature">
|
215
|
+
|
216
|
+
<a href="#kj-instance_method" title="#kj (instance method)">#<strong>kj</strong> ⇒ Object </a>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
</span>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<span class="note title readonly">readonly</span>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
<span class="summary_desc"><div class='inline'>
|
236
|
+
<p>Getters de las variables de instancia.</p>
|
237
|
+
</div></span>
|
238
|
+
|
239
|
+
</li>
|
240
|
+
|
241
|
+
|
242
|
+
<li class="public ">
|
243
|
+
<span class="summary_signature">
|
244
|
+
|
245
|
+
<a href="#n_portions-instance_method" title="#n_portions (instance method)">#<strong>n_portions</strong> ⇒ Object </a>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</span>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
<span class="note title readonly">readonly</span>
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
<span class="summary_desc"><div class='inline'>
|
265
|
+
<p>Getters de las variables de instancia.</p>
|
266
|
+
</div></span>
|
267
|
+
|
268
|
+
</li>
|
269
|
+
|
270
|
+
|
271
|
+
<li class="public ">
|
272
|
+
<span class="summary_signature">
|
273
|
+
|
274
|
+
<a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> ⇒ Object </a>
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
</span>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
<span class="note title readonly">readonly</span>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
<span class="summary_desc"><div class='inline'>
|
294
|
+
<p>Getters de las variables de instancia.</p>
|
295
|
+
</div></span>
|
296
|
+
|
297
|
+
</li>
|
298
|
+
|
299
|
+
|
300
|
+
<li class="public ">
|
301
|
+
<span class="summary_signature">
|
302
|
+
|
303
|
+
<a href="#portion_size-instance_method" title="#portion_size (instance method)">#<strong>portion_size</strong> ⇒ Object </a>
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
</span>
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
<span class="note title readonly">readonly</span>
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
<span class="summary_desc"><div class='inline'>
|
323
|
+
<p>Getters de las variables de instancia.</p>
|
324
|
+
</div></span>
|
325
|
+
|
326
|
+
</li>
|
327
|
+
|
328
|
+
|
329
|
+
<li class="public ">
|
330
|
+
<span class="summary_signature">
|
331
|
+
|
332
|
+
<a href="#portions-instance_method" title="#portions (instance method)">#<strong>portions</strong> ⇒ Object </a>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
</span>
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
<span class="note title readonly">readonly</span>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<span class="summary_desc"><div class='inline'>
|
352
|
+
<p>Getters de las variables de instancia.</p>
|
353
|
+
</div></span>
|
354
|
+
|
355
|
+
</li>
|
356
|
+
|
357
|
+
|
358
|
+
<li class="public ">
|
359
|
+
<span class="summary_signature">
|
360
|
+
|
361
|
+
<a href="#protein-instance_method" title="#protein (instance method)">#<strong>protein</strong> ⇒ Object </a>
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
</span>
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
<span class="note title readonly">readonly</span>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
<span class="summary_desc"><div class='inline'>
|
381
|
+
<p>Getters de las variables de instancia.</p>
|
382
|
+
</div></span>
|
383
|
+
|
384
|
+
</li>
|
385
|
+
|
386
|
+
|
387
|
+
<li class="public ">
|
388
|
+
<span class="summary_signature">
|
389
|
+
|
390
|
+
<a href="#s_fats-instance_method" title="#s_fats (instance method)">#<strong>s_fats</strong> ⇒ Object </a>
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
</span>
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
<span class="note title readonly">readonly</span>
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
<span class="summary_desc"><div class='inline'>
|
410
|
+
<p>Getters de las variables de instancia.</p>
|
411
|
+
</div></span>
|
412
|
+
|
413
|
+
</li>
|
414
|
+
|
415
|
+
|
416
|
+
<li class="public ">
|
417
|
+
<span class="summary_signature">
|
418
|
+
|
419
|
+
<a href="#salt-instance_method" title="#salt (instance method)">#<strong>salt</strong> ⇒ Object </a>
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
</span>
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
<span class="note title readonly">readonly</span>
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
<span class="summary_desc"><div class='inline'>
|
439
|
+
<p>Getters de las variables de instancia.</p>
|
440
|
+
</div></span>
|
441
|
+
|
442
|
+
</li>
|
443
|
+
|
444
|
+
|
445
|
+
<li class="public ">
|
446
|
+
<span class="summary_signature">
|
447
|
+
|
448
|
+
<a href="#sugar-instance_method" title="#sugar (instance method)">#<strong>sugar</strong> ⇒ Object </a>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
</span>
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
<span class="note title readonly">readonly</span>
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
<span class="summary_desc"><div class='inline'>
|
468
|
+
<p>Getters de las variables de instancia.</p>
|
469
|
+
</div></span>
|
470
|
+
|
471
|
+
</li>
|
472
|
+
|
473
|
+
|
474
|
+
</ul>
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
<h2>
|
481
|
+
Instance Method Summary
|
482
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
483
|
+
</h2>
|
484
|
+
|
485
|
+
<ul class="summary">
|
486
|
+
|
487
|
+
<li class="public ">
|
488
|
+
<span class="summary_signature">
|
489
|
+
|
490
|
+
<a href="#<=>-instance_method" title="#<=> (instance method)">#<strong><=></strong>(other) ⇒ Object </a>
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
</span>
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
<span class="summary_desc"><div class='inline'>
|
505
|
+
<p>Se define para incluir el mixin Comparable Se toma como valor para la
|
506
|
+
comparación los kJ (Valor que devuelve la función calculate_calories).</p>
|
507
|
+
</div></span>
|
508
|
+
|
509
|
+
</li>
|
510
|
+
|
511
|
+
|
512
|
+
<li class="public ">
|
513
|
+
<span class="summary_signature">
|
514
|
+
|
515
|
+
<a href="#==-instance_method" title="#== (instance method)">#<strong>==</strong>(other) ⇒ Object </a>
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
</span>
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
<span class="summary_desc"><div class='inline'>
|
530
|
+
<p>Override del == Se toman para considerar iguales: kcal, grasas,
|
531
|
+
carbohidratos, proteínas y sal.</p>
|
532
|
+
</div></span>
|
533
|
+
|
534
|
+
</li>
|
535
|
+
|
536
|
+
|
537
|
+
<li class="public ">
|
538
|
+
<span class="summary_signature">
|
539
|
+
|
540
|
+
<a href="#calculate_calories-instance_method" title="#calculate_calories (instance method)">#<strong>calculate_calories</strong> ⇒ Object </a>
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
</span>
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
<span class="summary_desc"><div class='inline'>
|
555
|
+
<p>Función que gendetermina las kilocalorías y los kilojulios de los
|
556
|
+
alimentos.</p>
|
557
|
+
</div></span>
|
558
|
+
|
559
|
+
</li>
|
560
|
+
|
561
|
+
|
562
|
+
<li class="public ">
|
563
|
+
<span class="summary_signature">
|
564
|
+
|
565
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, portions, n_portions, portion_size, fats, s_fats, carbs, sugar, protein, salt) ⇒ Etiqueta </a>
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
</span>
|
570
|
+
|
571
|
+
|
572
|
+
<span class="note title constructor">constructor</span>
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
<span class="summary_desc"><div class='inline'>
|
582
|
+
<p>Se genera la etiqueta con los datos del alimento proporcionados.</p>
|
583
|
+
</div></span>
|
584
|
+
|
585
|
+
</li>
|
586
|
+
|
587
|
+
|
588
|
+
<li class="public ">
|
589
|
+
<span class="summary_signature">
|
590
|
+
|
591
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> ⇒ Object </a>
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
</span>
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
<span class="summary_desc"><div class='inline'>
|
606
|
+
<p>Override del to_s.</p>
|
607
|
+
</div></span>
|
608
|
+
|
609
|
+
</li>
|
610
|
+
|
611
|
+
|
612
|
+
</ul>
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
<div id="constructor_details" class="method_details_list">
|
617
|
+
<h2>Constructor Details</h2>
|
618
|
+
|
619
|
+
<div class="method_details first">
|
620
|
+
<h3 class="signature first" id="initialize-instance_method">
|
621
|
+
|
622
|
+
#<strong>initialize</strong>(name, portions, n_portions, portion_size, fats, s_fats, carbs, sugar, protein, salt) ⇒ <tt><span class='object_link'><a href="" title="Etiqueta (class)">Etiqueta</a></span></tt>
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
</h3><div class="docstring">
|
629
|
+
<div class="discussion">
|
630
|
+
|
631
|
+
<p>Se genera la etiqueta con los datos del alimento proporcionados</p>
|
632
|
+
|
633
|
+
|
634
|
+
</div>
|
635
|
+
</div>
|
636
|
+
<div class="tags">
|
637
|
+
|
638
|
+
|
639
|
+
</div><table class="source_code">
|
640
|
+
<tr>
|
641
|
+
<td>
|
642
|
+
<pre class="lines">
|
643
|
+
|
644
|
+
|
645
|
+
16
|
646
|
+
17
|
647
|
+
18</pre>
|
648
|
+
</td>
|
649
|
+
<td>
|
650
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 16</span>
|
651
|
+
|
652
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_portions'>portions</span><span class='comma'>,</span> <span class='id identifier rubyid_n_portions'>n_portions</span><span class='comma'>,</span> <span class='id identifier rubyid_portion_size'>portion_size</span><span class='comma'>,</span> <span class='id identifier rubyid_fats'>fats</span><span class='comma'>,</span> <span class='id identifier rubyid_s_fats'>s_fats</span><span class='comma'>,</span> <span class='id identifier rubyid_carbs'>carbs</span><span class='comma'>,</span> <span class='id identifier rubyid_sugar'>sugar</span><span class='comma'>,</span> <span class='id identifier rubyid_protein'>protein</span><span class='comma'>,</span> <span class='id identifier rubyid_salt'>salt</span><span class='rparen'>)</span>
|
653
|
+
<span class='ivar'>@name</span><span class='comma'>,</span> <span class='ivar'>@portions</span><span class='comma'>,</span> <span class='ivar'>@n_portions</span><span class='comma'>,</span> <span class='ivar'>@portion_size</span><span class='comma'>,</span> <span class='ivar'>@fats</span><span class='comma'>,</span> <span class='ivar'>@s_fats</span><span class='comma'>,</span> <span class='ivar'>@carbs</span><span class='comma'>,</span> <span class='ivar'>@sugar</span><span class='comma'>,</span> <span class='ivar'>@protein</span><span class='comma'>,</span> <span class='ivar'>@salt</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_portions'>portions</span><span class='comma'>,</span> <span class='id identifier rubyid_n_portions'>n_portions</span><span class='comma'>,</span> <span class='id identifier rubyid_portion_size'>portion_size</span><span class='comma'>,</span> <span class='id identifier rubyid_fats'>fats</span><span class='comma'>,</span> <span class='id identifier rubyid_s_fats'>s_fats</span><span class='comma'>,</span> <span class='id identifier rubyid_carbs'>carbs</span><span class='comma'>,</span> <span class='id identifier rubyid_sugar'>sugar</span><span class='comma'>,</span> <span class='id identifier rubyid_protein'>protein</span><span class='comma'>,</span> <span class='id identifier rubyid_salt'>salt</span>
|
654
|
+
<span class='kw'>end</span></pre>
|
655
|
+
</td>
|
656
|
+
</tr>
|
657
|
+
</table>
|
658
|
+
</div>
|
659
|
+
|
660
|
+
</div>
|
661
|
+
|
662
|
+
<div id="instance_attr_details" class="attr_details">
|
663
|
+
<h2>Instance Attribute Details</h2>
|
664
|
+
|
665
|
+
|
666
|
+
<span id=""></span>
|
667
|
+
<div class="method_details first">
|
668
|
+
<h3 class="signature first" id="carbs-instance_method">
|
669
|
+
|
670
|
+
#<strong>carbs</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
</h3><div class="docstring">
|
677
|
+
<div class="discussion">
|
678
|
+
|
679
|
+
<p>Getters de las variables de instancia</p>
|
680
|
+
|
681
|
+
|
682
|
+
</div>
|
683
|
+
</div>
|
684
|
+
<div class="tags">
|
685
|
+
|
686
|
+
|
687
|
+
</div><table class="source_code">
|
688
|
+
<tr>
|
689
|
+
<td>
|
690
|
+
<pre class="lines">
|
691
|
+
|
692
|
+
|
693
|
+
13
|
694
|
+
14
|
695
|
+
15</pre>
|
696
|
+
</td>
|
697
|
+
<td>
|
698
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
699
|
+
|
700
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_carbs'>carbs</span>
|
701
|
+
<span class='ivar'>@carbs</span>
|
702
|
+
<span class='kw'>end</span></pre>
|
703
|
+
</td>
|
704
|
+
</tr>
|
705
|
+
</table>
|
706
|
+
</div>
|
707
|
+
|
708
|
+
|
709
|
+
<span id=""></span>
|
710
|
+
<div class="method_details ">
|
711
|
+
<h3 class="signature " id="fats-instance_method">
|
712
|
+
|
713
|
+
#<strong>fats</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
714
|
+
|
715
|
+
|
716
|
+
|
717
|
+
|
718
|
+
|
719
|
+
</h3><div class="docstring">
|
720
|
+
<div class="discussion">
|
721
|
+
|
722
|
+
<p>Getters de las variables de instancia</p>
|
723
|
+
|
724
|
+
|
725
|
+
</div>
|
726
|
+
</div>
|
727
|
+
<div class="tags">
|
728
|
+
|
729
|
+
|
730
|
+
</div><table class="source_code">
|
731
|
+
<tr>
|
732
|
+
<td>
|
733
|
+
<pre class="lines">
|
734
|
+
|
735
|
+
|
736
|
+
13
|
737
|
+
14
|
738
|
+
15</pre>
|
739
|
+
</td>
|
740
|
+
<td>
|
741
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
742
|
+
|
743
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fats'>fats</span>
|
744
|
+
<span class='ivar'>@fats</span>
|
745
|
+
<span class='kw'>end</span></pre>
|
746
|
+
</td>
|
747
|
+
</tr>
|
748
|
+
</table>
|
749
|
+
</div>
|
750
|
+
|
751
|
+
|
752
|
+
<span id=""></span>
|
753
|
+
<div class="method_details ">
|
754
|
+
<h3 class="signature " id="kcal-instance_method">
|
755
|
+
|
756
|
+
#<strong>kcal</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
|
761
|
+
|
762
|
+
</h3><div class="docstring">
|
763
|
+
<div class="discussion">
|
764
|
+
|
765
|
+
<p>Getters de las variables de instancia</p>
|
766
|
+
|
767
|
+
|
768
|
+
</div>
|
769
|
+
</div>
|
770
|
+
<div class="tags">
|
771
|
+
|
772
|
+
|
773
|
+
</div><table class="source_code">
|
774
|
+
<tr>
|
775
|
+
<td>
|
776
|
+
<pre class="lines">
|
777
|
+
|
778
|
+
|
779
|
+
13
|
780
|
+
14
|
781
|
+
15</pre>
|
782
|
+
</td>
|
783
|
+
<td>
|
784
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
785
|
+
|
786
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_kcal'>kcal</span>
|
787
|
+
<span class='ivar'>@kcal</span>
|
788
|
+
<span class='kw'>end</span></pre>
|
789
|
+
</td>
|
790
|
+
</tr>
|
791
|
+
</table>
|
792
|
+
</div>
|
793
|
+
|
794
|
+
|
795
|
+
<span id=""></span>
|
796
|
+
<div class="method_details ">
|
797
|
+
<h3 class="signature " id="kj-instance_method">
|
798
|
+
|
799
|
+
#<strong>kj</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
800
|
+
|
801
|
+
|
802
|
+
|
803
|
+
|
804
|
+
|
805
|
+
</h3><div class="docstring">
|
806
|
+
<div class="discussion">
|
807
|
+
|
808
|
+
<p>Getters de las variables de instancia</p>
|
809
|
+
|
810
|
+
|
811
|
+
</div>
|
812
|
+
</div>
|
813
|
+
<div class="tags">
|
814
|
+
|
815
|
+
|
816
|
+
</div><table class="source_code">
|
817
|
+
<tr>
|
818
|
+
<td>
|
819
|
+
<pre class="lines">
|
820
|
+
|
821
|
+
|
822
|
+
13
|
823
|
+
14
|
824
|
+
15</pre>
|
825
|
+
</td>
|
826
|
+
<td>
|
827
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
828
|
+
|
829
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_kj'>kj</span>
|
830
|
+
<span class='ivar'>@kj</span>
|
831
|
+
<span class='kw'>end</span></pre>
|
832
|
+
</td>
|
833
|
+
</tr>
|
834
|
+
</table>
|
835
|
+
</div>
|
836
|
+
|
837
|
+
|
838
|
+
<span id=""></span>
|
839
|
+
<div class="method_details ">
|
840
|
+
<h3 class="signature " id="n_portions-instance_method">
|
841
|
+
|
842
|
+
#<strong>n_portions</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
843
|
+
|
844
|
+
|
845
|
+
|
846
|
+
|
847
|
+
|
848
|
+
</h3><div class="docstring">
|
849
|
+
<div class="discussion">
|
850
|
+
|
851
|
+
<p>Getters de las variables de instancia</p>
|
852
|
+
|
853
|
+
|
854
|
+
</div>
|
855
|
+
</div>
|
856
|
+
<div class="tags">
|
857
|
+
|
858
|
+
|
859
|
+
</div><table class="source_code">
|
860
|
+
<tr>
|
861
|
+
<td>
|
862
|
+
<pre class="lines">
|
863
|
+
|
864
|
+
|
865
|
+
13
|
866
|
+
14
|
867
|
+
15</pre>
|
868
|
+
</td>
|
869
|
+
<td>
|
870
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
871
|
+
|
872
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_n_portions'>n_portions</span>
|
873
|
+
<span class='ivar'>@n_portions</span>
|
874
|
+
<span class='kw'>end</span></pre>
|
875
|
+
</td>
|
876
|
+
</tr>
|
877
|
+
</table>
|
878
|
+
</div>
|
879
|
+
|
880
|
+
|
881
|
+
<span id=""></span>
|
882
|
+
<div class="method_details ">
|
883
|
+
<h3 class="signature " id="name-instance_method">
|
884
|
+
|
885
|
+
#<strong>name</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
886
|
+
|
887
|
+
|
888
|
+
|
889
|
+
|
890
|
+
|
891
|
+
</h3><div class="docstring">
|
892
|
+
<div class="discussion">
|
893
|
+
|
894
|
+
<p>Getters de las variables de instancia</p>
|
895
|
+
|
896
|
+
|
897
|
+
</div>
|
898
|
+
</div>
|
899
|
+
<div class="tags">
|
900
|
+
|
901
|
+
|
902
|
+
</div><table class="source_code">
|
903
|
+
<tr>
|
904
|
+
<td>
|
905
|
+
<pre class="lines">
|
906
|
+
|
907
|
+
|
908
|
+
13
|
909
|
+
14
|
910
|
+
15</pre>
|
911
|
+
</td>
|
912
|
+
<td>
|
913
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
914
|
+
|
915
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
916
|
+
<span class='ivar'>@name</span>
|
917
|
+
<span class='kw'>end</span></pre>
|
918
|
+
</td>
|
919
|
+
</tr>
|
920
|
+
</table>
|
921
|
+
</div>
|
922
|
+
|
923
|
+
|
924
|
+
<span id=""></span>
|
925
|
+
<div class="method_details ">
|
926
|
+
<h3 class="signature " id="portion_size-instance_method">
|
927
|
+
|
928
|
+
#<strong>portion_size</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
929
|
+
|
930
|
+
|
931
|
+
|
932
|
+
|
933
|
+
|
934
|
+
</h3><div class="docstring">
|
935
|
+
<div class="discussion">
|
936
|
+
|
937
|
+
<p>Getters de las variables de instancia</p>
|
938
|
+
|
939
|
+
|
940
|
+
</div>
|
941
|
+
</div>
|
942
|
+
<div class="tags">
|
943
|
+
|
944
|
+
|
945
|
+
</div><table class="source_code">
|
946
|
+
<tr>
|
947
|
+
<td>
|
948
|
+
<pre class="lines">
|
949
|
+
|
950
|
+
|
951
|
+
13
|
952
|
+
14
|
953
|
+
15</pre>
|
954
|
+
</td>
|
955
|
+
<td>
|
956
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
957
|
+
|
958
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_portion_size'>portion_size</span>
|
959
|
+
<span class='ivar'>@portion_size</span>
|
960
|
+
<span class='kw'>end</span></pre>
|
961
|
+
</td>
|
962
|
+
</tr>
|
963
|
+
</table>
|
964
|
+
</div>
|
965
|
+
|
966
|
+
|
967
|
+
<span id=""></span>
|
968
|
+
<div class="method_details ">
|
969
|
+
<h3 class="signature " id="portions-instance_method">
|
970
|
+
|
971
|
+
#<strong>portions</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
972
|
+
|
973
|
+
|
974
|
+
|
975
|
+
|
976
|
+
|
977
|
+
</h3><div class="docstring">
|
978
|
+
<div class="discussion">
|
979
|
+
|
980
|
+
<p>Getters de las variables de instancia</p>
|
981
|
+
|
982
|
+
|
983
|
+
</div>
|
984
|
+
</div>
|
985
|
+
<div class="tags">
|
986
|
+
|
987
|
+
|
988
|
+
</div><table class="source_code">
|
989
|
+
<tr>
|
990
|
+
<td>
|
991
|
+
<pre class="lines">
|
992
|
+
|
993
|
+
|
994
|
+
13
|
995
|
+
14
|
996
|
+
15</pre>
|
997
|
+
</td>
|
998
|
+
<td>
|
999
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
1000
|
+
|
1001
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_portions'>portions</span>
|
1002
|
+
<span class='ivar'>@portions</span>
|
1003
|
+
<span class='kw'>end</span></pre>
|
1004
|
+
</td>
|
1005
|
+
</tr>
|
1006
|
+
</table>
|
1007
|
+
</div>
|
1008
|
+
|
1009
|
+
|
1010
|
+
<span id=""></span>
|
1011
|
+
<div class="method_details ">
|
1012
|
+
<h3 class="signature " id="protein-instance_method">
|
1013
|
+
|
1014
|
+
#<strong>protein</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
1015
|
+
|
1016
|
+
|
1017
|
+
|
1018
|
+
|
1019
|
+
|
1020
|
+
</h3><div class="docstring">
|
1021
|
+
<div class="discussion">
|
1022
|
+
|
1023
|
+
<p>Getters de las variables de instancia</p>
|
1024
|
+
|
1025
|
+
|
1026
|
+
</div>
|
1027
|
+
</div>
|
1028
|
+
<div class="tags">
|
1029
|
+
|
1030
|
+
|
1031
|
+
</div><table class="source_code">
|
1032
|
+
<tr>
|
1033
|
+
<td>
|
1034
|
+
<pre class="lines">
|
1035
|
+
|
1036
|
+
|
1037
|
+
13
|
1038
|
+
14
|
1039
|
+
15</pre>
|
1040
|
+
</td>
|
1041
|
+
<td>
|
1042
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
1043
|
+
|
1044
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_protein'>protein</span>
|
1045
|
+
<span class='ivar'>@protein</span>
|
1046
|
+
<span class='kw'>end</span></pre>
|
1047
|
+
</td>
|
1048
|
+
</tr>
|
1049
|
+
</table>
|
1050
|
+
</div>
|
1051
|
+
|
1052
|
+
|
1053
|
+
<span id=""></span>
|
1054
|
+
<div class="method_details ">
|
1055
|
+
<h3 class="signature " id="s_fats-instance_method">
|
1056
|
+
|
1057
|
+
#<strong>s_fats</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
1058
|
+
|
1059
|
+
|
1060
|
+
|
1061
|
+
|
1062
|
+
|
1063
|
+
</h3><div class="docstring">
|
1064
|
+
<div class="discussion">
|
1065
|
+
|
1066
|
+
<p>Getters de las variables de instancia</p>
|
1067
|
+
|
1068
|
+
|
1069
|
+
</div>
|
1070
|
+
</div>
|
1071
|
+
<div class="tags">
|
1072
|
+
|
1073
|
+
|
1074
|
+
</div><table class="source_code">
|
1075
|
+
<tr>
|
1076
|
+
<td>
|
1077
|
+
<pre class="lines">
|
1078
|
+
|
1079
|
+
|
1080
|
+
13
|
1081
|
+
14
|
1082
|
+
15</pre>
|
1083
|
+
</td>
|
1084
|
+
<td>
|
1085
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
1086
|
+
|
1087
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_s_fats'>s_fats</span>
|
1088
|
+
<span class='ivar'>@s_fats</span>
|
1089
|
+
<span class='kw'>end</span></pre>
|
1090
|
+
</td>
|
1091
|
+
</tr>
|
1092
|
+
</table>
|
1093
|
+
</div>
|
1094
|
+
|
1095
|
+
|
1096
|
+
<span id=""></span>
|
1097
|
+
<div class="method_details ">
|
1098
|
+
<h3 class="signature " id="salt-instance_method">
|
1099
|
+
|
1100
|
+
#<strong>salt</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
1101
|
+
|
1102
|
+
|
1103
|
+
|
1104
|
+
|
1105
|
+
|
1106
|
+
</h3><div class="docstring">
|
1107
|
+
<div class="discussion">
|
1108
|
+
|
1109
|
+
<p>Getters de las variables de instancia</p>
|
1110
|
+
|
1111
|
+
|
1112
|
+
</div>
|
1113
|
+
</div>
|
1114
|
+
<div class="tags">
|
1115
|
+
|
1116
|
+
|
1117
|
+
</div><table class="source_code">
|
1118
|
+
<tr>
|
1119
|
+
<td>
|
1120
|
+
<pre class="lines">
|
1121
|
+
|
1122
|
+
|
1123
|
+
13
|
1124
|
+
14
|
1125
|
+
15</pre>
|
1126
|
+
</td>
|
1127
|
+
<td>
|
1128
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
1129
|
+
|
1130
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_salt'>salt</span>
|
1131
|
+
<span class='ivar'>@salt</span>
|
1132
|
+
<span class='kw'>end</span></pre>
|
1133
|
+
</td>
|
1134
|
+
</tr>
|
1135
|
+
</table>
|
1136
|
+
</div>
|
1137
|
+
|
1138
|
+
|
1139
|
+
<span id=""></span>
|
1140
|
+
<div class="method_details ">
|
1141
|
+
<h3 class="signature " id="sugar-instance_method">
|
1142
|
+
|
1143
|
+
#<strong>sugar</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
1144
|
+
|
1145
|
+
|
1146
|
+
|
1147
|
+
|
1148
|
+
|
1149
|
+
</h3><div class="docstring">
|
1150
|
+
<div class="discussion">
|
1151
|
+
|
1152
|
+
<p>Getters de las variables de instancia</p>
|
1153
|
+
|
1154
|
+
|
1155
|
+
</div>
|
1156
|
+
</div>
|
1157
|
+
<div class="tags">
|
1158
|
+
|
1159
|
+
|
1160
|
+
</div><table class="source_code">
|
1161
|
+
<tr>
|
1162
|
+
<td>
|
1163
|
+
<pre class="lines">
|
1164
|
+
|
1165
|
+
|
1166
|
+
13
|
1167
|
+
14
|
1168
|
+
15</pre>
|
1169
|
+
</td>
|
1170
|
+
<td>
|
1171
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 13</span>
|
1172
|
+
|
1173
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sugar'>sugar</span>
|
1174
|
+
<span class='ivar'>@sugar</span>
|
1175
|
+
<span class='kw'>end</span></pre>
|
1176
|
+
</td>
|
1177
|
+
</tr>
|
1178
|
+
</table>
|
1179
|
+
</div>
|
1180
|
+
|
1181
|
+
</div>
|
1182
|
+
|
1183
|
+
|
1184
|
+
<div id="instance_method_details" class="method_details_list">
|
1185
|
+
<h2>Instance Method Details</h2>
|
1186
|
+
|
1187
|
+
|
1188
|
+
<div class="method_details first">
|
1189
|
+
<h3 class="signature first" id="<=>-instance_method">
|
1190
|
+
|
1191
|
+
#<strong><=></strong>(other) ⇒ <tt>Object</tt>
|
1192
|
+
|
1193
|
+
|
1194
|
+
|
1195
|
+
|
1196
|
+
|
1197
|
+
</h3><div class="docstring">
|
1198
|
+
<div class="discussion">
|
1199
|
+
|
1200
|
+
<p>Se define para incluir el mixin Comparable Se toma como valor para la
|
1201
|
+
comparación los kJ (Valor que devuelve la función calculate_calories)</p>
|
1202
|
+
|
1203
|
+
|
1204
|
+
</div>
|
1205
|
+
</div>
|
1206
|
+
<div class="tags">
|
1207
|
+
|
1208
|
+
|
1209
|
+
</div><table class="source_code">
|
1210
|
+
<tr>
|
1211
|
+
<td>
|
1212
|
+
<pre class="lines">
|
1213
|
+
|
1214
|
+
|
1215
|
+
38
|
1216
|
+
39
|
1217
|
+
40
|
1218
|
+
41</pre>
|
1219
|
+
</td>
|
1220
|
+
<td>
|
1221
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 38</span>
|
1222
|
+
|
1223
|
+
<span class='kw'>def</span> <span class='op'><=></span> <span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
1224
|
+
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='const'>Etiqueta</span>
|
1225
|
+
<span class='id identifier rubyid_calculate_calories'>calculate_calories</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_calculate_calories'>calculate_calories</span>
|
1226
|
+
<span class='kw'>end</span></pre>
|
1227
|
+
</td>
|
1228
|
+
</tr>
|
1229
|
+
</table>
|
1230
|
+
</div>
|
1231
|
+
|
1232
|
+
<div class="method_details ">
|
1233
|
+
<h3 class="signature " id="==-instance_method">
|
1234
|
+
|
1235
|
+
#<strong>==</strong>(other) ⇒ <tt>Object</tt>
|
1236
|
+
|
1237
|
+
|
1238
|
+
|
1239
|
+
|
1240
|
+
|
1241
|
+
</h3><div class="docstring">
|
1242
|
+
<div class="discussion">
|
1243
|
+
|
1244
|
+
<p>Override del == Se toman para considerar iguales: kcal, grasas,
|
1245
|
+
carbohidratos, proteínas y sal</p>
|
1246
|
+
|
1247
|
+
|
1248
|
+
</div>
|
1249
|
+
</div>
|
1250
|
+
<div class="tags">
|
1251
|
+
|
1252
|
+
|
1253
|
+
</div><table class="source_code">
|
1254
|
+
<tr>
|
1255
|
+
<td>
|
1256
|
+
<pre class="lines">
|
1257
|
+
|
1258
|
+
|
1259
|
+
46
|
1260
|
+
47
|
1261
|
+
48
|
1262
|
+
49
|
1263
|
+
50
|
1264
|
+
51
|
1265
|
+
52
|
1266
|
+
53</pre>
|
1267
|
+
</td>
|
1268
|
+
<td>
|
1269
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 46</span>
|
1270
|
+
|
1271
|
+
<span class='kw'>def</span> <span class='op'>==</span> <span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
1272
|
+
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='const'>Etiqueta</span>
|
1273
|
+
<span class='ivar'>@kcal</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_kcal'>kcal</span>
|
1274
|
+
<span class='ivar'>@fats</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_fats'>fats</span>
|
1275
|
+
<span class='ivar'>@carbs</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_carbs'>carbs</span>
|
1276
|
+
<span class='ivar'>@protein</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_protein'>protein</span>
|
1277
|
+
<span class='ivar'>@salt</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_salt'>salt</span>
|
1278
|
+
<span class='kw'>end</span></pre>
|
1279
|
+
</td>
|
1280
|
+
</tr>
|
1281
|
+
</table>
|
1282
|
+
</div>
|
1283
|
+
|
1284
|
+
<div class="method_details ">
|
1285
|
+
<h3 class="signature " id="calculate_calories-instance_method">
|
1286
|
+
|
1287
|
+
#<strong>calculate_calories</strong> ⇒ <tt>Object</tt>
|
1288
|
+
|
1289
|
+
|
1290
|
+
|
1291
|
+
|
1292
|
+
|
1293
|
+
</h3><div class="docstring">
|
1294
|
+
<div class="discussion">
|
1295
|
+
|
1296
|
+
<p>Función que gendetermina las kilocalorías y los kilojulios de los
|
1297
|
+
alimentos</p>
|
1298
|
+
|
1299
|
+
|
1300
|
+
</div>
|
1301
|
+
</div>
|
1302
|
+
<div class="tags">
|
1303
|
+
|
1304
|
+
|
1305
|
+
</div><table class="source_code">
|
1306
|
+
<tr>
|
1307
|
+
<td>
|
1308
|
+
<pre class="lines">
|
1309
|
+
|
1310
|
+
|
1311
|
+
21
|
1312
|
+
22
|
1313
|
+
23
|
1314
|
+
24</pre>
|
1315
|
+
</td>
|
1316
|
+
<td>
|
1317
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 21</span>
|
1318
|
+
|
1319
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_calculate_calories'>calculate_calories</span>
|
1320
|
+
<span class='ivar'>@kcal</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@fats</span> <span class='op'>*</span> <span class='int'>9</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@carbs</span> <span class='op'>*</span> <span class='int'>4</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@protein</span> <span class='op'>*</span> <span class='int'>4</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@salt</span> <span class='op'>*</span> <span class='int'>6</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span>
|
1321
|
+
<span class='ivar'>@kj</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@fats</span> <span class='op'>*</span> <span class='int'>37</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@carbs</span> <span class='op'>*</span> <span class='int'>17</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@protein</span> <span class='op'>*</span> <span class='int'>17</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@salt</span> <span class='op'>*</span> <span class='int'>28</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span>
|
1322
|
+
<span class='kw'>end</span></pre>
|
1323
|
+
</td>
|
1324
|
+
</tr>
|
1325
|
+
</table>
|
1326
|
+
</div>
|
1327
|
+
|
1328
|
+
<div class="method_details ">
|
1329
|
+
<h3 class="signature " id="to_s-instance_method">
|
1330
|
+
|
1331
|
+
#<strong>to_s</strong> ⇒ <tt>Object</tt>
|
1332
|
+
|
1333
|
+
|
1334
|
+
|
1335
|
+
|
1336
|
+
|
1337
|
+
</h3><div class="docstring">
|
1338
|
+
<div class="discussion">
|
1339
|
+
|
1340
|
+
<p>Override del to_s</p>
|
1341
|
+
|
1342
|
+
|
1343
|
+
</div>
|
1344
|
+
</div>
|
1345
|
+
<div class="tags">
|
1346
|
+
|
1347
|
+
|
1348
|
+
</div><table class="source_code">
|
1349
|
+
<tr>
|
1350
|
+
<td>
|
1351
|
+
<pre class="lines">
|
1352
|
+
|
1353
|
+
|
1354
|
+
27
|
1355
|
+
28
|
1356
|
+
29
|
1357
|
+
30
|
1358
|
+
31
|
1359
|
+
32
|
1360
|
+
33</pre>
|
1361
|
+
</td>
|
1362
|
+
<td>
|
1363
|
+
<pre class="code"><span class="info file"># File 'lib/InformacionNutricional/etiqueta.rb', line 27</span>
|
1364
|
+
|
1365
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
1366
|
+
<span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
1367
|
+
<span class='kw'>if</span> <span class='ivar'>@portions</span> <span class='op'>==</span> <span class='kw'>true</span>
|
1368
|
+
<span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='ivar'>@n_portions</span><span class='embexpr_end'>}</span><span class='tstring_content'> porciones; </span><span class='embexpr_beg'>#{</span><span class='ivar'>@portion_size</span><span class='embexpr_end'>}</span><span class='tstring_content'>g/porcion)</span><span class='tstring_end'>"</span></span>
|
1369
|
+
<span class='kw'>end</span>
|
1370
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='ivar'>@name</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_s'>s</span><span class='embexpr_end'>}</span><span class='tstring_content'>: Por 100g - IR; VALOR ENERGETICO: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@kcal</span><span class='embexpr_end'>}</span><span class='tstring_content'> kcal/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@kj</span><span class='embexpr_end'>}</span><span class='tstring_content'> kJ - 2000 kcal/8400 kJ; GRASAS: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@fats</span><span class='embexpr_end'>}</span><span class='tstring_content'>g - 70g; SATURADAS: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@s_fats</span><span class='embexpr_end'>}</span><span class='tstring_content'>g - 20g; CARBOHIDRATOS: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@carbs</span><span class='embexpr_end'>}</span><span class='tstring_content'>g - 260g; AZUCARES: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@sugar</span><span class='embexpr_end'>}</span><span class='tstring_content'>g - 90g; PROTEINAS: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@protein</span><span class='embexpr_end'>}</span><span class='tstring_content'>g - 50g; SAL: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@salt</span><span class='embexpr_end'>}</span><span class='tstring_content'>g - 6g;</span><span class='tstring_end'>"</span></span>
|
1371
|
+
<span class='kw'>end</span></pre>
|
1372
|
+
</td>
|
1373
|
+
</tr>
|
1374
|
+
</table>
|
1375
|
+
</div>
|
1376
|
+
|
1377
|
+
</div>
|
1378
|
+
|
1379
|
+
</div>
|
1380
|
+
|
1381
|
+
<div id="footer">
|
1382
|
+
Generated on Tue Nov 27 20:37:14 2018 by
|
1383
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1384
|
+
0.9.16 (ruby-2.5.1).
|
1385
|
+
</div>
|
1386
|
+
|
1387
|
+
</div>
|
1388
|
+
</body>
|
1389
|
+
</html>
|