practica7 0.3.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/.DS_Store +0 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +11 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/documentation/Diet.html +1170 -0
- data/documentation/Dietedad.html +310 -0
- data/documentation/Diettipo.html +310 -0
- data/documentation/LinkedList.html +676 -0
- data/documentation/Node.html +411 -0
- data/documentation/Practica7.html +117 -0
- data/documentation/_index.html +158 -0
- data/documentation/class_list.html +51 -0
- data/documentation/css/common.css +1 -0
- data/documentation/css/full_list.css +58 -0
- data/documentation/css/style.css +481 -0
- data/documentation/file.README.html +128 -0
- data/documentation/file_list.html +56 -0
- data/documentation/frames.html +17 -0
- data/documentation/index.html +128 -0
- data/documentation/js/app.js +243 -0
- data/documentation/js/full_list.js +216 -0
- data/documentation/js/jquery.js +4 -0
- data/documentation/method_list.html +275 -0
- data/documentation/top-level-namespace.html +114 -0
- data/lib/.DS_Store +0 -0
- data/lib/practica7/.DS_Store +0 -0
- data/lib/practica7/diet.rb +80 -0
- data/lib/practica7/practica7.rb +38 -0
- data/lib/practica7/version.rb +3 -0
- data/practica7.gemspec +39 -0
- metadata +166 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2ecc563327121362a7acf18e653744800089fb27
|
4
|
+
data.tar.gz: 6b20869f06ff08777502aff69d4b5093ec2b092a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b9a19cb17282b1ff15fa1d5f9bacc6d4ddd5922420c59232e59b4447d877e937c209641403dc6cb640460e9bec732961089be02505385198977cfb4342c1a020
|
7
|
+
data.tar.gz: 5060a9fdc9665478e367b402da1a702d0dc01c8662ebabbb7dd77d2892922fc7235d0be717602ae7a976dc095bc9f32179898179e56eaab6cc4557518401f8a5
|
data/.DS_Store
ADDED
Binary file
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at alu0100881677@ull.edu.es. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
guard :bundler do
|
19
|
+
require 'guard/bundler'
|
20
|
+
require 'guard/bundler/verify'
|
21
|
+
helper = Guard::Bundler::Verify.new
|
22
|
+
|
23
|
+
files = ['Gemfile']
|
24
|
+
files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
|
25
|
+
|
26
|
+
# Assume files are symlinked from somewhere
|
27
|
+
files.each { |file| watch(helper.real_path(file)) }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
31
|
+
# rspec may be run, below are examples of the most common uses.
|
32
|
+
# * bundler: 'bundle exec rspec'
|
33
|
+
# * bundler binstubs: 'bin/rspec'
|
34
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
35
|
+
# installed the spring binstubs per the docs)
|
36
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
37
|
+
# * 'just' rspec: 'rspec'
|
38
|
+
|
39
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
40
|
+
require "guard/rspec/dsl"
|
41
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
42
|
+
|
43
|
+
# Feel free to open issues for suggestions and improvements
|
44
|
+
|
45
|
+
# RSpec files
|
46
|
+
rspec = dsl.rspec
|
47
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
48
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
49
|
+
watch(rspec.spec_files)
|
50
|
+
|
51
|
+
# Ruby files
|
52
|
+
ruby = dsl.ruby
|
53
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
54
|
+
|
55
|
+
# Rails files
|
56
|
+
rails = dsl.rails(view_extensions: %w(erb haml slim))
|
57
|
+
dsl.watch_spec_files_for(rails.app_files)
|
58
|
+
dsl.watch_spec_files_for(rails.views)
|
59
|
+
|
60
|
+
watch(rails.controllers) do |m|
|
61
|
+
[
|
62
|
+
rspec.spec.call("routing/#{m[1]}_routing"),
|
63
|
+
rspec.spec.call("controllers/#{m[1]}_controller"),
|
64
|
+
rspec.spec.call("acceptance/#{m[1]}")
|
65
|
+
]
|
66
|
+
end
|
67
|
+
|
68
|
+
# Rails config changes
|
69
|
+
watch(rails.spec_helper) { rspec.spec_dir }
|
70
|
+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
71
|
+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
72
|
+
|
73
|
+
# Capybara features specs
|
74
|
+
watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
|
75
|
+
watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
|
76
|
+
|
77
|
+
# Turnip features and steps
|
78
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
79
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
80
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
81
|
+
end
|
82
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Guillermo
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Practica7
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/practica7`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'practica7'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install practica7
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/practica7. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "practica7"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,1170 @@
|
|
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: Diet
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.5
|
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 = "Diet";
|
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"></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 (D)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Diet</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
|
+
<iframe id="search_frame" src="class_list.html"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><h1>Class: Diet
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
74
|
+
<span class="inheritName">Object</span>
|
75
|
+
|
76
|
+
<ul class="fullTree">
|
77
|
+
<li>Object</li>
|
78
|
+
|
79
|
+
<li class="next">Diet</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/practica7/diet.rb</dd>
|
105
|
+
</dl>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<h2>Overview</h2><div class="docstring">
|
110
|
+
<div class="discussion">
|
111
|
+
|
112
|
+
<p>esta clase representa una dieta con atributos que representan las distintas
|
113
|
+
características que podría tener una dieta</p>
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
<div class="tags">
|
119
|
+
|
120
|
+
|
121
|
+
</div><div id="subclasses">
|
122
|
+
<h2>Direct Known Subclasses</h2>
|
123
|
+
<p class="children"><span class='object_link'><a href="Dietedad.html" title="Dietedad (class)">Dietedad</a></span>, <span class='object_link'><a href="Diettipo.html" title="Diettipo (class)">Diettipo</a></span></p>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
130
|
+
<ul class="summary">
|
131
|
+
|
132
|
+
<li class="public ">
|
133
|
+
<span class="summary_signature">
|
134
|
+
|
135
|
+
<a href="#con_plato-instance_method" title="#con_plato (instance method)">#<strong>con_plato</strong> ⇒ Object </a>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
</span>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<span class="note title readonly">readonly</span>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<span class="summary_desc"><div class='inline'>
|
155
|
+
<p>Returns the value of attribute con_plato.</p>
|
156
|
+
</div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
<li class="public ">
|
162
|
+
<span class="summary_signature">
|
163
|
+
|
164
|
+
<a href="#data-instance_method" title="#data (instance method)">#<strong>data</strong> ⇒ Object </a>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
</span>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<span class="note title readonly">readonly</span>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<span class="summary_desc"><div class='inline'>
|
184
|
+
<p>Returns the value of attribute data.</p>
|
185
|
+
</div></span>
|
186
|
+
|
187
|
+
</li>
|
188
|
+
|
189
|
+
|
190
|
+
<li class="public ">
|
191
|
+
<span class="summary_signature">
|
192
|
+
|
193
|
+
<a href="#des_plato-instance_method" title="#des_plato (instance method)">#<strong>des_plato</strong> ⇒ Object </a>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</span>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<span class="note title readonly">readonly</span>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<span class="summary_desc"><div class='inline'>
|
213
|
+
<p>Returns the value of attribute des_plato.</p>
|
214
|
+
</div></span>
|
215
|
+
|
216
|
+
</li>
|
217
|
+
|
218
|
+
|
219
|
+
<li class="public ">
|
220
|
+
<span class="summary_signature">
|
221
|
+
|
222
|
+
<a href="#percentage-instance_method" title="#percentage (instance method)">#<strong>percentage</strong> ⇒ Object </a>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
</span>
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<span class="note title readonly">readonly</span>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<span class="summary_desc"><div class='inline'>
|
242
|
+
<p>Returns the value of attribute percentage.</p>
|
243
|
+
</div></span>
|
244
|
+
|
245
|
+
</li>
|
246
|
+
|
247
|
+
|
248
|
+
<li class="public ">
|
249
|
+
<span class="summary_signature">
|
250
|
+
|
251
|
+
<a href="#title-instance_method" title="#title (instance method)">#<strong>title</strong> ⇒ Object </a>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</span>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
<span class="note title readonly">readonly</span>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<span class="summary_desc"><div class='inline'>
|
271
|
+
<p>permitimos leer desde fuera los siguientes atributos.</p>
|
272
|
+
</div></span>
|
273
|
+
|
274
|
+
</li>
|
275
|
+
|
276
|
+
|
277
|
+
<li class="public ">
|
278
|
+
<span class="summary_signature">
|
279
|
+
|
280
|
+
<a href="#vct-instance_method" title="#vct (instance method)">#<strong>vct</strong> ⇒ Object </a>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
</span>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
<span class="note title readonly">readonly</span>
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
<span class="summary_desc"><div class='inline'>
|
300
|
+
<p>Returns the value of attribute vct.</p>
|
301
|
+
</div></span>
|
302
|
+
|
303
|
+
</li>
|
304
|
+
|
305
|
+
|
306
|
+
</ul>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
<h2>
|
313
|
+
Instance Method Summary
|
314
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
315
|
+
</h2>
|
316
|
+
|
317
|
+
<ul class="summary">
|
318
|
+
|
319
|
+
<li class="public ">
|
320
|
+
<span class="summary_signature">
|
321
|
+
|
322
|
+
<a href="#%3C%3D%3E-instance_method" title="#<=> (instance method)">#<strong><=></strong>(other) ⇒ Object </a>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
</span>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
<span class="summary_desc"><div class='inline'>
|
337
|
+
<p>definiendo el metodo <=> del mixin Comparable.</p>
|
338
|
+
</div></span>
|
339
|
+
|
340
|
+
</li>
|
341
|
+
|
342
|
+
|
343
|
+
<li class="public ">
|
344
|
+
<span class="summary_signature">
|
345
|
+
|
346
|
+
<a href="#gras-instance_method" title="#gras (instance method)">#<strong>gras</strong> ⇒ Object </a>
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
</span>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
<span class="summary_desc"><div class='inline'>
|
361
|
+
<p>nos dice la grasa de la dieta.</p>
|
362
|
+
</div></span>
|
363
|
+
|
364
|
+
</li>
|
365
|
+
|
366
|
+
|
367
|
+
<li class="public ">
|
368
|
+
<span class="summary_signature">
|
369
|
+
|
370
|
+
<a href="#group_plates-instance_method" title="#group_plates (instance method)">#<strong>group_plates</strong> ⇒ Object </a>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
</span>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
<span class="summary_desc"><div class='inline'>
|
385
|
+
<p>nos devuelve un conjunto de platos.</p>
|
386
|
+
</div></span>
|
387
|
+
|
388
|
+
</li>
|
389
|
+
|
390
|
+
|
391
|
+
<li class="public ">
|
392
|
+
<span class="summary_signature">
|
393
|
+
|
394
|
+
<a href="#hid_car-instance_method" title="#hid_car (instance method)">#<strong>hid_car</strong> ⇒ Object </a>
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
</span>
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
<span class="summary_desc"><div class='inline'>
|
409
|
+
<p>nos devuelve los hidratos de carbono del menu.</p>
|
410
|
+
</div></span>
|
411
|
+
|
412
|
+
</li>
|
413
|
+
|
414
|
+
|
415
|
+
<li class="public ">
|
416
|
+
<span class="summary_signature">
|
417
|
+
|
418
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(title, percentage, con_plato, vct, data) ⇒ Diet </a>
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
</span>
|
423
|
+
|
424
|
+
|
425
|
+
<span class="note title constructor">constructor</span>
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
<span class="summary_desc"><div class='inline'>
|
435
|
+
<p>se asignan los diferentes campos de la dieta.</p>
|
436
|
+
</div></span>
|
437
|
+
|
438
|
+
</li>
|
439
|
+
|
440
|
+
|
441
|
+
<li class="public ">
|
442
|
+
<span class="summary_signature">
|
443
|
+
|
444
|
+
<a href="#obtain_plate-instance_method" title="#obtain_plate (instance method)">#<strong>obtain_plate</strong> ⇒ Object </a>
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
</span>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
<span class="summary_desc"><div class='inline'>
|
459
|
+
<p>nos devuelve el primer plato.</p>
|
460
|
+
</div></span>
|
461
|
+
|
462
|
+
</li>
|
463
|
+
|
464
|
+
|
465
|
+
<li class="public ">
|
466
|
+
<span class="summary_signature">
|
467
|
+
|
468
|
+
<a href="#prot-instance_method" title="#prot (instance method)">#<strong>prot</strong> ⇒ Object </a>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
</span>
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
<span class="summary_desc"><div class='inline'>
|
483
|
+
<p>nos dice las proteinas de la dieta.</p>
|
484
|
+
</div></span>
|
485
|
+
|
486
|
+
</li>
|
487
|
+
|
488
|
+
|
489
|
+
<li class="public ">
|
490
|
+
<span class="summary_signature">
|
491
|
+
|
492
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> ⇒ Object </a>
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
</span>
|
497
|
+
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
<span class="summary_desc"><div class='inline'>
|
507
|
+
<p>formateo de la salida por pantalla de una dieta.</p>
|
508
|
+
</div></span>
|
509
|
+
|
510
|
+
</li>
|
511
|
+
|
512
|
+
|
513
|
+
</ul>
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
<div id="constructor_details" class="method_details_list">
|
518
|
+
<h2>Constructor Details</h2>
|
519
|
+
|
520
|
+
<div class="method_details first">
|
521
|
+
<h3 class="signature first" id="initialize-instance_method">
|
522
|
+
|
523
|
+
#<strong>initialize</strong>(title, percentage, con_plato, vct, data) ⇒ <tt><span class='object_link'><a href="" title="Diet (class)">Diet</a></span></tt>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
</h3><div class="docstring">
|
530
|
+
<div class="discussion">
|
531
|
+
|
532
|
+
<p>se asignan los diferentes campos de la dieta</p>
|
533
|
+
|
534
|
+
|
535
|
+
</div>
|
536
|
+
</div>
|
537
|
+
<div class="tags">
|
538
|
+
|
539
|
+
|
540
|
+
</div><table class="source_code">
|
541
|
+
<tr>
|
542
|
+
<td>
|
543
|
+
<pre class="lines">
|
544
|
+
|
545
|
+
|
546
|
+
21
|
547
|
+
22
|
548
|
+
23
|
549
|
+
24
|
550
|
+
25
|
551
|
+
26
|
552
|
+
27
|
553
|
+
28</pre>
|
554
|
+
</td>
|
555
|
+
<td>
|
556
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 21</span>
|
557
|
+
|
558
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_title'>title</span><span class='comma'>,</span><span class='id identifier rubyid_percentage'>percentage</span><span class='comma'>,</span><span class='id identifier rubyid_con_plato'>con_plato</span><span class='comma'>,</span><span class='id identifier rubyid_vct'>vct</span><span class='comma'>,</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
559
|
+
<span class='ivar'>@title</span><span class='op'>=</span><span class='id identifier rubyid_title'>title</span>
|
560
|
+
<span class='ivar'>@percentage</span><span class='op'>=</span><span class='id identifier rubyid_percentage'>percentage</span>
|
561
|
+
<span class='ivar'>@con_plato</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='op'>+</span> <span class='id identifier rubyid_con_plato'>con_plato</span>
|
562
|
+
<span class='ivar'>@des_plato</span> <span class='op'>=</span> <span class='id identifier rubyid_con_plato'>con_plato</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
563
|
+
<span class='ivar'>@vct</span> <span class='op'>=</span> <span class='id identifier rubyid_vct'>vct</span>
|
564
|
+
<span class='ivar'>@data</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='op'>+</span> <span class='id identifier rubyid_data'>data</span>
|
565
|
+
<span class='kw'>end</span></pre>
|
566
|
+
</td>
|
567
|
+
</tr>
|
568
|
+
</table>
|
569
|
+
</div>
|
570
|
+
|
571
|
+
</div>
|
572
|
+
|
573
|
+
<div id="instance_attr_details" class="attr_details">
|
574
|
+
<h2>Instance Attribute Details</h2>
|
575
|
+
|
576
|
+
|
577
|
+
<span id=""></span>
|
578
|
+
<div class="method_details first">
|
579
|
+
<h3 class="signature first" id="con_plato-instance_method">
|
580
|
+
|
581
|
+
#<strong>con_plato</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
</h3><div class="docstring">
|
588
|
+
<div class="discussion">
|
589
|
+
|
590
|
+
<p>Returns the value of attribute con_plato</p>
|
591
|
+
|
592
|
+
|
593
|
+
</div>
|
594
|
+
</div>
|
595
|
+
<div class="tags">
|
596
|
+
|
597
|
+
|
598
|
+
</div><table class="source_code">
|
599
|
+
<tr>
|
600
|
+
<td>
|
601
|
+
<pre class="lines">
|
602
|
+
|
603
|
+
|
604
|
+
15
|
605
|
+
16
|
606
|
+
17</pre>
|
607
|
+
</td>
|
608
|
+
<td>
|
609
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 15</span>
|
610
|
+
|
611
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_con_plato'>con_plato</span>
|
612
|
+
<span class='ivar'>@con_plato</span>
|
613
|
+
<span class='kw'>end</span></pre>
|
614
|
+
</td>
|
615
|
+
</tr>
|
616
|
+
</table>
|
617
|
+
</div>
|
618
|
+
|
619
|
+
|
620
|
+
<span id=""></span>
|
621
|
+
<div class="method_details ">
|
622
|
+
<h3 class="signature " id="data-instance_method">
|
623
|
+
|
624
|
+
#<strong>data</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
</h3><div class="docstring">
|
631
|
+
<div class="discussion">
|
632
|
+
|
633
|
+
<p>Returns the value of attribute data</p>
|
634
|
+
|
635
|
+
|
636
|
+
</div>
|
637
|
+
</div>
|
638
|
+
<div class="tags">
|
639
|
+
|
640
|
+
|
641
|
+
</div><table class="source_code">
|
642
|
+
<tr>
|
643
|
+
<td>
|
644
|
+
<pre class="lines">
|
645
|
+
|
646
|
+
|
647
|
+
16
|
648
|
+
17
|
649
|
+
18</pre>
|
650
|
+
</td>
|
651
|
+
<td>
|
652
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 16</span>
|
653
|
+
|
654
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span>
|
655
|
+
<span class='ivar'>@data</span>
|
656
|
+
<span class='kw'>end</span></pre>
|
657
|
+
</td>
|
658
|
+
</tr>
|
659
|
+
</table>
|
660
|
+
</div>
|
661
|
+
|
662
|
+
|
663
|
+
<span id=""></span>
|
664
|
+
<div class="method_details ">
|
665
|
+
<h3 class="signature " id="des_plato-instance_method">
|
666
|
+
|
667
|
+
#<strong>des_plato</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
</h3><div class="docstring">
|
674
|
+
<div class="discussion">
|
675
|
+
|
676
|
+
<p>Returns the value of attribute des_plato</p>
|
677
|
+
|
678
|
+
|
679
|
+
</div>
|
680
|
+
</div>
|
681
|
+
<div class="tags">
|
682
|
+
|
683
|
+
|
684
|
+
</div><table class="source_code">
|
685
|
+
<tr>
|
686
|
+
<td>
|
687
|
+
<pre class="lines">
|
688
|
+
|
689
|
+
|
690
|
+
14
|
691
|
+
15
|
692
|
+
16</pre>
|
693
|
+
</td>
|
694
|
+
<td>
|
695
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 14</span>
|
696
|
+
|
697
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_des_plato'>des_plato</span>
|
698
|
+
<span class='ivar'>@des_plato</span>
|
699
|
+
<span class='kw'>end</span></pre>
|
700
|
+
</td>
|
701
|
+
</tr>
|
702
|
+
</table>
|
703
|
+
</div>
|
704
|
+
|
705
|
+
|
706
|
+
<span id=""></span>
|
707
|
+
<div class="method_details ">
|
708
|
+
<h3 class="signature " id="percentage-instance_method">
|
709
|
+
|
710
|
+
#<strong>percentage</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
711
|
+
|
712
|
+
|
713
|
+
|
714
|
+
|
715
|
+
|
716
|
+
</h3><div class="docstring">
|
717
|
+
<div class="discussion">
|
718
|
+
|
719
|
+
<p>Returns the value of attribute percentage</p>
|
720
|
+
|
721
|
+
|
722
|
+
</div>
|
723
|
+
</div>
|
724
|
+
<div class="tags">
|
725
|
+
|
726
|
+
|
727
|
+
</div><table class="source_code">
|
728
|
+
<tr>
|
729
|
+
<td>
|
730
|
+
<pre class="lines">
|
731
|
+
|
732
|
+
|
733
|
+
13
|
734
|
+
14
|
735
|
+
15</pre>
|
736
|
+
</td>
|
737
|
+
<td>
|
738
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 13</span>
|
739
|
+
|
740
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_percentage'>percentage</span>
|
741
|
+
<span class='ivar'>@percentage</span>
|
742
|
+
<span class='kw'>end</span></pre>
|
743
|
+
</td>
|
744
|
+
</tr>
|
745
|
+
</table>
|
746
|
+
</div>
|
747
|
+
|
748
|
+
|
749
|
+
<span id=""></span>
|
750
|
+
<div class="method_details ">
|
751
|
+
<h3 class="signature " id="title-instance_method">
|
752
|
+
|
753
|
+
#<strong>title</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
754
|
+
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
</h3><div class="docstring">
|
760
|
+
<div class="discussion">
|
761
|
+
|
762
|
+
<p>permitimos leer desde fuera los siguientes atributos</p>
|
763
|
+
|
764
|
+
|
765
|
+
</div>
|
766
|
+
</div>
|
767
|
+
<div class="tags">
|
768
|
+
|
769
|
+
|
770
|
+
</div><table class="source_code">
|
771
|
+
<tr>
|
772
|
+
<td>
|
773
|
+
<pre class="lines">
|
774
|
+
|
775
|
+
|
776
|
+
12
|
777
|
+
13
|
778
|
+
14</pre>
|
779
|
+
</td>
|
780
|
+
<td>
|
781
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 12</span>
|
782
|
+
|
783
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_title'>title</span>
|
784
|
+
<span class='ivar'>@title</span>
|
785
|
+
<span class='kw'>end</span></pre>
|
786
|
+
</td>
|
787
|
+
</tr>
|
788
|
+
</table>
|
789
|
+
</div>
|
790
|
+
|
791
|
+
|
792
|
+
<span id=""></span>
|
793
|
+
<div class="method_details ">
|
794
|
+
<h3 class="signature " id="vct-instance_method">
|
795
|
+
|
796
|
+
#<strong>vct</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
|
802
|
+
</h3><div class="docstring">
|
803
|
+
<div class="discussion">
|
804
|
+
|
805
|
+
<p>Returns the value of attribute vct</p>
|
806
|
+
|
807
|
+
|
808
|
+
</div>
|
809
|
+
</div>
|
810
|
+
<div class="tags">
|
811
|
+
|
812
|
+
|
813
|
+
</div><table class="source_code">
|
814
|
+
<tr>
|
815
|
+
<td>
|
816
|
+
<pre class="lines">
|
817
|
+
|
818
|
+
|
819
|
+
17
|
820
|
+
18
|
821
|
+
19</pre>
|
822
|
+
</td>
|
823
|
+
<td>
|
824
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 17</span>
|
825
|
+
|
826
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_vct'>vct</span>
|
827
|
+
<span class='ivar'>@vct</span>
|
828
|
+
<span class='kw'>end</span></pre>
|
829
|
+
</td>
|
830
|
+
</tr>
|
831
|
+
</table>
|
832
|
+
</div>
|
833
|
+
|
834
|
+
</div>
|
835
|
+
|
836
|
+
|
837
|
+
<div id="instance_method_details" class="method_details_list">
|
838
|
+
<h2>Instance Method Details</h2>
|
839
|
+
|
840
|
+
|
841
|
+
<div class="method_details first">
|
842
|
+
<h3 class="signature first" id="<=>-instance_method">
|
843
|
+
|
844
|
+
#<strong><=></strong>(other) ⇒ <tt>Object</tt>
|
845
|
+
|
846
|
+
|
847
|
+
|
848
|
+
|
849
|
+
|
850
|
+
</h3><div class="docstring">
|
851
|
+
<div class="discussion">
|
852
|
+
|
853
|
+
<p>definiendo el metodo <=> del mixin Comparable</p>
|
854
|
+
|
855
|
+
|
856
|
+
</div>
|
857
|
+
</div>
|
858
|
+
<div class="tags">
|
859
|
+
|
860
|
+
|
861
|
+
</div><table class="source_code">
|
862
|
+
<tr>
|
863
|
+
<td>
|
864
|
+
<pre class="lines">
|
865
|
+
|
866
|
+
|
867
|
+
68
|
868
|
+
69
|
869
|
+
70
|
870
|
+
71</pre>
|
871
|
+
</td>
|
872
|
+
<td>
|
873
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 68</span>
|
874
|
+
|
875
|
+
<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>
|
876
|
+
<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'>Diet</span>
|
877
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_vct'>vct</span><span class='op'><=></span><span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_vct'>vct</span>
|
878
|
+
<span class='kw'>end</span></pre>
|
879
|
+
</td>
|
880
|
+
</tr>
|
881
|
+
</table>
|
882
|
+
</div>
|
883
|
+
|
884
|
+
<div class="method_details ">
|
885
|
+
<h3 class="signature " id="gras-instance_method">
|
886
|
+
|
887
|
+
#<strong>gras</strong> ⇒ <tt>Object</tt>
|
888
|
+
|
889
|
+
|
890
|
+
|
891
|
+
|
892
|
+
|
893
|
+
</h3><div class="docstring">
|
894
|
+
<div class="discussion">
|
895
|
+
|
896
|
+
<p>nos dice la grasa de la dieta</p>
|
897
|
+
|
898
|
+
|
899
|
+
</div>
|
900
|
+
</div>
|
901
|
+
<div class="tags">
|
902
|
+
|
903
|
+
|
904
|
+
</div><table class="source_code">
|
905
|
+
<tr>
|
906
|
+
<td>
|
907
|
+
<pre class="lines">
|
908
|
+
|
909
|
+
|
910
|
+
49
|
911
|
+
50
|
912
|
+
51</pre>
|
913
|
+
</td>
|
914
|
+
<td>
|
915
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 49</span>
|
916
|
+
|
917
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_gras'>gras</span>
|
918
|
+
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
919
|
+
<span class='kw'>end</span></pre>
|
920
|
+
</td>
|
921
|
+
</tr>
|
922
|
+
</table>
|
923
|
+
</div>
|
924
|
+
|
925
|
+
<div class="method_details ">
|
926
|
+
<h3 class="signature " id="group_plates-instance_method">
|
927
|
+
|
928
|
+
#<strong>group_plates</strong> ⇒ <tt>Object</tt>
|
929
|
+
|
930
|
+
|
931
|
+
|
932
|
+
|
933
|
+
|
934
|
+
</h3><div class="docstring">
|
935
|
+
<div class="discussion">
|
936
|
+
|
937
|
+
<p>nos devuelve un conjunto de platos</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
|
+
34
|
952
|
+
35
|
953
|
+
36
|
954
|
+
37
|
955
|
+
38
|
956
|
+
39
|
957
|
+
40
|
958
|
+
41
|
959
|
+
42
|
960
|
+
43</pre>
|
961
|
+
</td>
|
962
|
+
<td>
|
963
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 34</span>
|
964
|
+
|
965
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_group_plates'>group_plates</span>
|
966
|
+
<span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_con_plato'>con_plato</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
967
|
+
<span class='gvar'>$i</span><span class='op'>=</span><span class='int'>1</span>
|
968
|
+
<span class='kw'>while</span> <span class='gvar'>$i</span> <span class='op'><</span> <span class='id identifier rubyid_con_plato'>con_plato</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='kw'>do</span>
|
969
|
+
<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='tstring_end'>"</span></span>
|
970
|
+
<span class='id identifier rubyid_s'>s</span><span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_con_plato'>con_plato</span><span class='lbracket'>[</span><span class='gvar'>$i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
971
|
+
<span class='gvar'>$i</span><span class='op'>+=</span><span class='int'>1</span>
|
972
|
+
<span class='kw'>end</span>
|
973
|
+
<span class='id identifier rubyid_s'>s</span>
|
974
|
+
<span class='kw'>end</span></pre>
|
975
|
+
</td>
|
976
|
+
</tr>
|
977
|
+
</table>
|
978
|
+
</div>
|
979
|
+
|
980
|
+
<div class="method_details ">
|
981
|
+
<h3 class="signature " id="hid_car-instance_method">
|
982
|
+
|
983
|
+
#<strong>hid_car</strong> ⇒ <tt>Object</tt>
|
984
|
+
|
985
|
+
|
986
|
+
|
987
|
+
|
988
|
+
|
989
|
+
</h3><div class="docstring">
|
990
|
+
<div class="discussion">
|
991
|
+
|
992
|
+
<p>nos devuelve los hidratos de carbono del menu</p>
|
993
|
+
|
994
|
+
|
995
|
+
</div>
|
996
|
+
</div>
|
997
|
+
<div class="tags">
|
998
|
+
|
999
|
+
|
1000
|
+
</div><table class="source_code">
|
1001
|
+
<tr>
|
1002
|
+
<td>
|
1003
|
+
<pre class="lines">
|
1004
|
+
|
1005
|
+
|
1006
|
+
53
|
1007
|
+
54
|
1008
|
+
55</pre>
|
1009
|
+
</td>
|
1010
|
+
<td>
|
1011
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 53</span>
|
1012
|
+
|
1013
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hid_car'>hid_car</span>
|
1014
|
+
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span>
|
1015
|
+
<span class='kw'>end</span></pre>
|
1016
|
+
</td>
|
1017
|
+
</tr>
|
1018
|
+
</table>
|
1019
|
+
</div>
|
1020
|
+
|
1021
|
+
<div class="method_details ">
|
1022
|
+
<h3 class="signature " id="obtain_plate-instance_method">
|
1023
|
+
|
1024
|
+
#<strong>obtain_plate</strong> ⇒ <tt>Object</tt>
|
1025
|
+
|
1026
|
+
|
1027
|
+
|
1028
|
+
|
1029
|
+
|
1030
|
+
</h3><div class="docstring">
|
1031
|
+
<div class="discussion">
|
1032
|
+
|
1033
|
+
<p>nos devuelve el primer plato</p>
|
1034
|
+
|
1035
|
+
|
1036
|
+
</div>
|
1037
|
+
</div>
|
1038
|
+
<div class="tags">
|
1039
|
+
|
1040
|
+
|
1041
|
+
</div><table class="source_code">
|
1042
|
+
<tr>
|
1043
|
+
<td>
|
1044
|
+
<pre class="lines">
|
1045
|
+
|
1046
|
+
|
1047
|
+
30
|
1048
|
+
31
|
1049
|
+
32</pre>
|
1050
|
+
</td>
|
1051
|
+
<td>
|
1052
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 30</span>
|
1053
|
+
|
1054
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_obtain_plate'>obtain_plate</span>
|
1055
|
+
<span class='id identifier rubyid_con_plato'>con_plato</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
1056
|
+
<span class='kw'>end</span></pre>
|
1057
|
+
</td>
|
1058
|
+
</tr>
|
1059
|
+
</table>
|
1060
|
+
</div>
|
1061
|
+
|
1062
|
+
<div class="method_details ">
|
1063
|
+
<h3 class="signature " id="prot-instance_method">
|
1064
|
+
|
1065
|
+
#<strong>prot</strong> ⇒ <tt>Object</tt>
|
1066
|
+
|
1067
|
+
|
1068
|
+
|
1069
|
+
|
1070
|
+
|
1071
|
+
</h3><div class="docstring">
|
1072
|
+
<div class="discussion">
|
1073
|
+
|
1074
|
+
<p>nos dice las proteinas de la dieta</p>
|
1075
|
+
|
1076
|
+
|
1077
|
+
</div>
|
1078
|
+
</div>
|
1079
|
+
<div class="tags">
|
1080
|
+
|
1081
|
+
|
1082
|
+
</div><table class="source_code">
|
1083
|
+
<tr>
|
1084
|
+
<td>
|
1085
|
+
<pre class="lines">
|
1086
|
+
|
1087
|
+
|
1088
|
+
45
|
1089
|
+
46
|
1090
|
+
47</pre>
|
1091
|
+
</td>
|
1092
|
+
<td>
|
1093
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 45</span>
|
1094
|
+
|
1095
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_prot'>prot</span>
|
1096
|
+
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
1097
|
+
<span class='kw'>end</span></pre>
|
1098
|
+
</td>
|
1099
|
+
</tr>
|
1100
|
+
</table>
|
1101
|
+
</div>
|
1102
|
+
|
1103
|
+
<div class="method_details ">
|
1104
|
+
<h3 class="signature " id="to_s-instance_method">
|
1105
|
+
|
1106
|
+
#<strong>to_s</strong> ⇒ <tt>Object</tt>
|
1107
|
+
|
1108
|
+
|
1109
|
+
|
1110
|
+
|
1111
|
+
|
1112
|
+
</h3><div class="docstring">
|
1113
|
+
<div class="discussion">
|
1114
|
+
|
1115
|
+
<p>formateo de la salida por pantalla de una dieta</p>
|
1116
|
+
|
1117
|
+
|
1118
|
+
</div>
|
1119
|
+
</div>
|
1120
|
+
<div class="tags">
|
1121
|
+
|
1122
|
+
|
1123
|
+
</div><table class="source_code">
|
1124
|
+
<tr>
|
1125
|
+
<td>
|
1126
|
+
<pre class="lines">
|
1127
|
+
|
1128
|
+
|
1129
|
+
57
|
1130
|
+
58
|
1131
|
+
59
|
1132
|
+
60
|
1133
|
+
61
|
1134
|
+
62
|
1135
|
+
63
|
1136
|
+
64
|
1137
|
+
65
|
1138
|
+
66</pre>
|
1139
|
+
</td>
|
1140
|
+
<td>
|
1141
|
+
<pre class="code"><span class="info file"># File 'lib/practica7/diet.rb', line 57</span>
|
1142
|
+
|
1143
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
1144
|
+
<span class='id identifier rubyid_s'>s</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_title'>title</span><span class='embexpr_end'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_percentage'>percentage</span><span class='embexpr_end'>}</span><span class='tstring_content'>%)\n</span><span class='tstring_end'>"</span></span>
|
1145
|
+
<span class='gvar'>$i</span><span class='op'>=</span><span class='int'>0</span>
|
1146
|
+
<span class='kw'>while</span> <span class='gvar'>$i</span><span class='op'><</span><span class='id identifier rubyid_con_plato'>con_plato</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='kw'>do</span>
|
1147
|
+
<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='id identifier rubyid_con_plato'>con_plato</span><span class='lbracket'>[</span><span class='gvar'>$i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_con_plato'>con_plato</span><span class='lbracket'>[</span><span class='gvar'>$i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_con_plato'>con_plato</span><span class='lbracket'>[</span><span class='gvar'>$i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> gr\n</span><span class='tstring_end'>"</span></span>
|
1148
|
+
<span class='gvar'>$i</span><span class='op'>+=</span><span class='int'>1</span>
|
1149
|
+
<span class='kw'>end</span>
|
1150
|
+
<span class='id identifier rubyid_s'>s</span><span class='op'>+=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>V.C.T | % </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_vct'>vct</span><span class='embexpr_end'>}</span><span class='tstring_content'> kcal | </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>% - </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> - </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1151
|
+
|
1152
|
+
<span class='kw'>end</span></pre>
|
1153
|
+
</td>
|
1154
|
+
</tr>
|
1155
|
+
</table>
|
1156
|
+
</div>
|
1157
|
+
|
1158
|
+
</div>
|
1159
|
+
|
1160
|
+
</div>
|
1161
|
+
|
1162
|
+
<div id="footer">
|
1163
|
+
Generated on Tue Nov 22 23:11:07 2016 by
|
1164
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1165
|
+
0.9.5 (ruby-2.3.0).
|
1166
|
+
</div>
|
1167
|
+
|
1168
|
+
</div>
|
1169
|
+
</body>
|
1170
|
+
</html>
|