alimento-alu0100948226 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 +12 -0
- data/.rspec +2 -0
- data/.travis.yml +6 -0
- data/Gemfile +8 -0
- data/Guardfile +82 -0
- data/README.md +35 -0
- data/Rakefile +16 -0
- data/alimento.gemspec +39 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/.yardoc/checksums +0 -0
- data/docs/.yardoc/complete +0 -0
- data/docs/.yardoc/object_types +0 -0
- data/docs/.yardoc/objects/root.dat +0 -0
- data/docs/.yardoc/proxy_types +0 -0
- data/docs/Alimento.html +178 -0
- data/docs/Alimento/AlimentoClas.html +394 -0
- data/docs/Alimento/Alimentos.html +734 -0
- data/docs/Alimento/Dll.html +925 -0
- data/docs/Alimento/Nodo.html +494 -0
- data/docs/_index.html +151 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +492 -0
- data/docs/file.README.html +117 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +117 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +251 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/alimento.rb +50 -0
- data/lib/alimento/alimento_clasificado.rb +29 -0
- data/lib/alimento/alimentos.rb +49 -0
- data/lib/alimento/array.rb +33 -0
- data/lib/alimento/dll.rb +112 -0
- data/lib/alimento/plato.rb +115 -0
- data/lib/alimento/version.rb +3 -0
- data/pec +35 -0
- metadata +185 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cab66078a89664b15d3f5eb88e9a8bb39e0f2950
|
4
|
+
data.tar.gz: fc31c66ab0ea3e26ec2f30671e295ae9d1f89b8c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cdbec591a9c5429556f726b1b3231bbd1feead0c7ea582665ae06fb4cafdc413c4c7038b9e70d21307853379234cbe558a7a197441f3e4f6b2de19a7e9ceddb3
|
7
|
+
data.tar.gz: ece9441368829bb27e88842cbf7a247399df44605af769e44cc2f2c17688aee775253d0d2c03f10bf939408818499252cb977ade4eda80965a4ae71d99df5283
|
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/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
@@ -0,0 +1,35 @@
|
|
1
|
+
# Alimento
|
2
|
+
Probando travis
|
3
|
+
Creación de la gema para trabajar y representar alimentos para la acomodación a diferentes paradigmas y la realización de las prácticas de la asignatura de Lenguajes y Paradigma de la Programación
|
4
|
+
Además incluye la funcionalidad para crear platos !!!
|
5
|
+
Travis
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'alimento'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install alimento
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Cada clase está definida en sus respectivas páginas de la documentación
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100948226.
|
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
|
+
|
7
|
+
task :default => :specs
|
8
|
+
|
9
|
+
desc "Pruebas sobre alimento"
|
10
|
+
task :specs do
|
11
|
+
sh "rspec -I spec/alimento_spec.rb"
|
12
|
+
end
|
13
|
+
|
14
|
+
task :dll do
|
15
|
+
sh "rspec -I spec/dll_spec.rb"
|
16
|
+
end
|
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 = "alimento-alu0100948226"
|
8
|
+
spec.version = Alimento::VERSION
|
9
|
+
spec.authors = ["Gabriel Rodríguez"]
|
10
|
+
spec.email = ["alu0100948226@ull.edu.es"]
|
11
|
+
|
12
|
+
spec.summary = %q{Alimento contiene información relevante para la identificación y cálculo del valor energético}
|
13
|
+
# spec.description = %q{}
|
14
|
+
spec.homepage = "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100948226.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"] = "http://github.com/ULL-ESIT-LPP-1718/tdd-alu0100948226.git"
|
20
|
+
#else
|
21
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
22
|
+
# "public gem pushes."
|
23
|
+
#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
File without changes
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
data/docs/Alimento.html
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: Alimento
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Alimento";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (A)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Alimento</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: Alimento
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/alimento.rb<span class="defines">,<br />
|
82
|
+
lib/alimento/dll.rb,<br /> lib/alimento/version.rb,<br /> lib/alimento/alimentos.rb,<br /> lib/alimento/alimento_clasificado.rb</span>
|
83
|
+
</dd>
|
84
|
+
</dl>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<h2>Defined Under Namespace</h2>
|
89
|
+
<p class="children">
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Alimento/AlimentoClas.html" title="Alimento::AlimentoClas (class)">AlimentoClas</a></span>, <span class='object_link'><a href="Alimento/Alimentos.html" title="Alimento::Alimentos (class)">Alimentos</a></span>, <span class='object_link'><a href="Alimento/Dll.html" title="Alimento::Dll (class)">Dll</a></span>, <span class='object_link'><a href="Alimento/Nodo.html" title="Alimento::Nodo (class)">Nodo</a></span>
|
95
|
+
|
96
|
+
|
97
|
+
</p>
|
98
|
+
|
99
|
+
<h2>Constant Summary</h2>
|
100
|
+
<dl class="constants">
|
101
|
+
|
102
|
+
<dt id="VERSION-constant" class="">VERSION =
|
103
|
+
|
104
|
+
</dt>
|
105
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.1.0</span><span class='tstring_end'>"</span></span></pre></dd>
|
106
|
+
|
107
|
+
<dt id="VAL_EN_GLUCIDOS-constant" class="">VAL_EN_GLUCIDOS =
|
108
|
+
<div class="docstring">
|
109
|
+
<div class="discussion">
|
110
|
+
|
111
|
+
<p>Constante que representa el valor energético que se obtiene de los glúcidos
|
112
|
+
de un alimento</p>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
<div class="tags">
|
118
|
+
|
119
|
+
|
120
|
+
</div>
|
121
|
+
</dt>
|
122
|
+
<dd><pre class="code"><span class='int'>4</span></pre></dd>
|
123
|
+
|
124
|
+
<dt id="VAL_EN_LIPIDOS-constant" class="">VAL_EN_LIPIDOS =
|
125
|
+
<div class="docstring">
|
126
|
+
<div class="discussion">
|
127
|
+
|
128
|
+
<p>Constante que representa el valor energético que se obtiene de los lípidos
|
129
|
+
de un alimento</p>
|
130
|
+
|
131
|
+
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
<div class="tags">
|
135
|
+
|
136
|
+
|
137
|
+
</div>
|
138
|
+
</dt>
|
139
|
+
<dd><pre class="code"><span class='int'>9</span></pre></dd>
|
140
|
+
|
141
|
+
<dt id="VAL_EN_PROTEINAS-constant" class="">VAL_EN_PROTEINAS =
|
142
|
+
<div class="docstring">
|
143
|
+
<div class="discussion">
|
144
|
+
|
145
|
+
<p>Constante que representa el valor energético que se obtiene de las
|
146
|
+
proteinas de un alimento</p>
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
<div class="tags">
|
152
|
+
|
153
|
+
|
154
|
+
</div>
|
155
|
+
</dt>
|
156
|
+
<dd><pre class="code"><span class='int'>4</span></pre></dd>
|
157
|
+
|
158
|
+
</dl>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div id="footer">
|
171
|
+
Generated on Fri Nov 17 11:01:03 2017 by
|
172
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
173
|
+
0.9.9 (ruby-2.3.1).
|
174
|
+
</div>
|
175
|
+
|
176
|
+
</div>
|
177
|
+
</body>
|
178
|
+
</html>
|
@@ -0,0 +1,394 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Alimento::AlimentoClas
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Alimento::AlimentoClas";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (A)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Alimento.html" title="Alimento (module)">Alimento</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">AlimentoClas</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Alimento::AlimentoClas
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Alimentos.html" title="Alimento::Alimentos (class)">Alimentos</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next"><span class='object_link'><a href="Alimentos.html" title="Alimento::Alimentos (class)">Alimentos</a></span></li>
|
78
|
+
|
79
|
+
<li class="next">Alimento::AlimentoClas</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
<dl>
|
93
|
+
<dt>Includes:</dt>
|
94
|
+
<dd>Comparable</dd>
|
95
|
+
</dl>
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<dl>
|
103
|
+
<dt>Defined in:</dt>
|
104
|
+
<dd>lib/alimento/alimento_clasificado.rb</dd>
|
105
|
+
</dl>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#tipo-instance_method" title="#tipo (instance method)">#<strong>tipo</strong> ⇒ Object </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<span class="note title readonly">readonly</span>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
<span class="summary_desc"><div class='inline'>
|
139
|
+
<p>Returns the value of attribute tipo.</p>
|
140
|
+
</div></span>
|
141
|
+
|
142
|
+
</li>
|
143
|
+
|
144
|
+
|
145
|
+
</ul>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Alimentos.html" title="Alimento::Alimentos (class)">Alimentos</a></span></h3>
|
152
|
+
<p class="inherited"><span class='object_link'><a href="Alimentos.html#glucidos-instance_method" title="Alimento::Alimentos#glucidos (method)">#glucidos</a></span>, <span class='object_link'><a href="Alimentos.html#lipidos-instance_method" title="Alimento::Alimentos#lipidos (method)">#lipidos</a></span>, <span class='object_link'><a href="Alimentos.html#nombre-instance_method" title="Alimento::Alimentos#nombre (method)">#nombre</a></span>, <span class='object_link'><a href="Alimentos.html#proteinas-instance_method" title="Alimento::Alimentos#proteinas (method)">#proteinas</a></span></p>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<h2>
|
157
|
+
Instance Method Summary
|
158
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
159
|
+
</h2>
|
160
|
+
|
161
|
+
<ul class="summary">
|
162
|
+
|
163
|
+
<li class="public ">
|
164
|
+
<span class="summary_signature">
|
165
|
+
|
166
|
+
<a href="#<=>-instance_method" title="#<=> (instance method)">#<strong><=></strong>(another) ⇒ Object </a>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
</span>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<span class="summary_desc"><div class='inline'>
|
181
|
+
<p>Incluido para poder usar los métodos del mixin Comparable.</p>
|
182
|
+
</div></span>
|
183
|
+
|
184
|
+
</li>
|
185
|
+
|
186
|
+
|
187
|
+
<li class="public ">
|
188
|
+
<span class="summary_signature">
|
189
|
+
|
190
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(nombre, proteinas, glucidos, lipidos, tipo) ⇒ AlimentoClas </a>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</span>
|
195
|
+
|
196
|
+
|
197
|
+
<span class="note title constructor">constructor</span>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<span class="summary_desc"><div class='inline'>
|
207
|
+
<p>Crea un alimento clasificado con su tipo.</p>
|
208
|
+
</div></span>
|
209
|
+
|
210
|
+
</li>
|
211
|
+
|
212
|
+
|
213
|
+
</ul>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Alimentos.html" title="Alimento::Alimentos (class)">Alimentos</a></span></h3>
|
227
|
+
<p class="inherited"><span class='object_link'><a href="Alimentos.html#calcValEn-instance_method" title="Alimento::Alimentos#calcValEn (method)">#calcValEn</a></span>, <span class='object_link'><a href="Alimentos.html#to_s-instance_method" title="Alimento::Alimentos#to_s (method)">#to_s</a></span></p>
|
228
|
+
|
229
|
+
<div id="constructor_details" class="method_details_list">
|
230
|
+
<h2>Constructor Details</h2>
|
231
|
+
|
232
|
+
<div class="method_details first">
|
233
|
+
<h3 class="signature first" id="initialize-instance_method">
|
234
|
+
|
235
|
+
#<strong>initialize</strong>(nombre, proteinas, glucidos, lipidos, tipo) ⇒ <tt><span class='object_link'><a href="" title="Alimento::AlimentoClas (class)">AlimentoClas</a></span></tt>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
</h3><div class="docstring">
|
242
|
+
<div class="discussion">
|
243
|
+
|
244
|
+
<p>Crea un alimento clasificado con su tipo. También llama al constructor de
|
245
|
+
la clase padre Alimento, dotándole de nombre y valores para los nutrientes</p>
|
246
|
+
|
247
|
+
|
248
|
+
</div>
|
249
|
+
</div>
|
250
|
+
<div class="tags">
|
251
|
+
|
252
|
+
|
253
|
+
</div><table class="source_code">
|
254
|
+
<tr>
|
255
|
+
<td>
|
256
|
+
<pre class="lines">
|
257
|
+
|
258
|
+
|
259
|
+
12
|
260
|
+
13
|
261
|
+
14
|
262
|
+
15</pre>
|
263
|
+
</td>
|
264
|
+
<td>
|
265
|
+
<pre class="code"><span class="info file"># File 'lib/alimento/alimento_clasificado.rb', line 12</span>
|
266
|
+
|
267
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_nombre'>nombre</span><span class='comma'>,</span> <span class='id identifier rubyid_proteinas'>proteinas</span><span class='comma'>,</span><span class='id identifier rubyid_glucidos'>glucidos</span><span class='comma'>,</span><span class='id identifier rubyid_lipidos'>lipidos</span><span class='comma'>,</span> <span class='id identifier rubyid_tipo'>tipo</span><span class='rparen'>)</span>
|
268
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_nombre'>nombre</span><span class='comma'>,</span><span class='id identifier rubyid_proteinas'>proteinas</span><span class='comma'>,</span><span class='id identifier rubyid_glucidos'>glucidos</span><span class='comma'>,</span><span class='id identifier rubyid_lipidos'>lipidos</span><span class='rparen'>)</span>
|
269
|
+
<span class='ivar'>@tipo</span> <span class='op'>=</span> <span class='id identifier rubyid_tipo'>tipo</span>
|
270
|
+
<span class='kw'>end</span></pre>
|
271
|
+
</td>
|
272
|
+
</tr>
|
273
|
+
</table>
|
274
|
+
</div>
|
275
|
+
|
276
|
+
</div>
|
277
|
+
|
278
|
+
<div id="instance_attr_details" class="attr_details">
|
279
|
+
<h2>Instance Attribute Details</h2>
|
280
|
+
|
281
|
+
|
282
|
+
<span id=""></span>
|
283
|
+
<div class="method_details first">
|
284
|
+
<h3 class="signature first" id="tipo-instance_method">
|
285
|
+
|
286
|
+
#<strong>tipo</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</h3><div class="docstring">
|
293
|
+
<div class="discussion">
|
294
|
+
|
295
|
+
<p>Returns the value of attribute tipo</p>
|
296
|
+
|
297
|
+
|
298
|
+
</div>
|
299
|
+
</div>
|
300
|
+
<div class="tags">
|
301
|
+
|
302
|
+
|
303
|
+
</div><table class="source_code">
|
304
|
+
<tr>
|
305
|
+
<td>
|
306
|
+
<pre class="lines">
|
307
|
+
|
308
|
+
|
309
|
+
7
|
310
|
+
8
|
311
|
+
9</pre>
|
312
|
+
</td>
|
313
|
+
<td>
|
314
|
+
<pre class="code"><span class="info file"># File 'lib/alimento/alimento_clasificado.rb', line 7</span>
|
315
|
+
|
316
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_tipo'>tipo</span>
|
317
|
+
<span class='ivar'>@tipo</span>
|
318
|
+
<span class='kw'>end</span></pre>
|
319
|
+
</td>
|
320
|
+
</tr>
|
321
|
+
</table>
|
322
|
+
</div>
|
323
|
+
|
324
|
+
</div>
|
325
|
+
|
326
|
+
|
327
|
+
<div id="instance_method_details" class="method_details_list">
|
328
|
+
<h2>Instance Method Details</h2>
|
329
|
+
|
330
|
+
|
331
|
+
<div class="method_details first">
|
332
|
+
<h3 class="signature first" id="<=>-instance_method">
|
333
|
+
|
334
|
+
#<strong><=></strong>(another) ⇒ <tt>Object</tt>
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
</h3><div class="docstring">
|
341
|
+
<div class="discussion">
|
342
|
+
|
343
|
+
<p>Incluido para poder usar los métodos del mixin Comparable</p>
|
344
|
+
|
345
|
+
|
346
|
+
</div>
|
347
|
+
</div>
|
348
|
+
<div class="tags">
|
349
|
+
|
350
|
+
|
351
|
+
</div><table class="source_code">
|
352
|
+
<tr>
|
353
|
+
<td>
|
354
|
+
<pre class="lines">
|
355
|
+
|
356
|
+
|
357
|
+
18
|
358
|
+
19
|
359
|
+
20
|
360
|
+
21
|
361
|
+
22
|
362
|
+
23
|
363
|
+
24
|
364
|
+
25</pre>
|
365
|
+
</td>
|
366
|
+
<td>
|
367
|
+
<pre class="code"><span class="info file"># File 'lib/alimento/alimento_clasificado.rb', line 18</span>
|
368
|
+
|
369
|
+
<span class='kw'>def</span> <span class='op'><=></span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='rparen'>)</span>
|
370
|
+
<span class='id identifier rubyid_compare'>compare</span> <span class='op'>=</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='rparen'>)</span>
|
371
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_compare'>compare</span> <span class='op'>==</span> <span class='int'>0</span>
|
372
|
+
<span class='kw'>return</span> <span class='ivar'>@tipo</span> <span class='op'><=></span> <span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_tipo'>tipo</span>
|
373
|
+
<span class='kw'>else</span>
|
374
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_compare'>compare</span>
|
375
|
+
<span class='kw'>end</span>
|
376
|
+
<span class='kw'>end</span></pre>
|
377
|
+
</td>
|
378
|
+
</tr>
|
379
|
+
</table>
|
380
|
+
</div>
|
381
|
+
|
382
|
+
</div>
|
383
|
+
|
384
|
+
</div>
|
385
|
+
|
386
|
+
<div id="footer">
|
387
|
+
Generated on Fri Nov 17 11:01:03 2017 by
|
388
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
389
|
+
0.9.9 (ruby-2.3.1).
|
390
|
+
</div>
|
391
|
+
|
392
|
+
</div>
|
393
|
+
</body>
|
394
|
+
</html>
|