practica6 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/Guardfile +82 -0
- data/README.md +36 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/practica6/dieta.rb +207 -0
- data/lib/practica6/doc/Alimentos.html +288 -0
- data/lib/practica6/doc/Dieta.html +1571 -0
- data/lib/practica6/doc/Edad.html +290 -0
- data/lib/practica6/doc/List.html +629 -0
- data/lib/practica6/doc/Node.html +400 -0
- data/lib/practica6/doc/Practica6.html +117 -0
- data/lib/practica6/doc/Untitled +0 -0
- data/lib/practica6/doc/_index.html +165 -0
- data/lib/practica6/doc/class_list.html +51 -0
- data/lib/practica6/doc/css/common.css +1 -0
- data/lib/practica6/doc/css/full_list.css +58 -0
- data/lib/practica6/doc/css/style.css +481 -0
- data/lib/practica6/doc/file_list.html +51 -0
- data/lib/practica6/doc/frames.html +17 -0
- data/lib/practica6/doc/index.html +165 -0
- data/lib/practica6/doc/js/app.js +243 -0
- data/lib/practica6/doc/js/full_list.js +216 -0
- data/lib/practica6/doc/js/jquery.js +4 -0
- data/lib/practica6/doc/method_list.html +331 -0
- data/lib/practica6/doc/top-level-namespace.html +114 -0
- data/lib/practica6/lista.rb +149 -0
- data/lib/practica6/node.rb +0 -0
- data/lib/practica6/version.rb +3 -0
- data/lib/practica6.rb +8 -0
- data/practica6.gemspec +38 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 23d702e5e1cb46dfc169449bf2047e0e396f834d
|
4
|
+
data.tar.gz: 9d92abd7feec64d7b5bd094e847e71072e4e014a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 297631394b4959cbca140a3e1813d3f5bc23c63bbd6de44c5050d21e1ad8c89be3cbdb5cc18087e6fbc033c52ec144bc304f866a5488ddd19e47383519e9692b
|
7
|
+
data.tar.gz: c819c8cbe1930ec2710fa7384e2f6bb23366875be3c16931f80d000316a793d45477bbf785808082d893473877e0976154dd4977c33c656d5406b947e00244ce
|
data/.gitignore
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,36 @@
|
|
1
|
+
# Practica6
|
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/practica6`. 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 'practica6'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install practica6
|
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]/practica6.
|
36
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "practica6"
|
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,207 @@
|
|
1
|
+
|
2
|
+
require "practica6/version"
|
3
|
+
|
4
|
+
class MenuDiet
|
5
|
+
|
6
|
+
attr_accessor :name, :titulo, :ingesta, :platos, :porcentajes
|
7
|
+
|
8
|
+
def initialize(name, &block)
|
9
|
+
self.name = name
|
10
|
+
self.titulo = ""
|
11
|
+
self.ingesta = []
|
12
|
+
self.platos = []
|
13
|
+
self.porcentajes = []
|
14
|
+
if block_given?
|
15
|
+
if block.arity == 1
|
16
|
+
yield self
|
17
|
+
else
|
18
|
+
instance_eval &block
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def met_titulo(name)
|
24
|
+
titulo << name
|
25
|
+
end
|
26
|
+
def met_ingesta(options = {})
|
27
|
+
ingest = []
|
28
|
+
|
29
|
+
if (options[:min] && options[:max])
|
30
|
+
ingest << options[:min]
|
31
|
+
ingest << options[:max]
|
32
|
+
else
|
33
|
+
ingest << options[:max]
|
34
|
+
end
|
35
|
+
|
36
|
+
ingesta << ingest
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def plato(options = {})
|
41
|
+
aux = []
|
42
|
+
aux << "#{options[:descripcion]}"
|
43
|
+
aux << "#{options[:porcion]}"
|
44
|
+
aux << "#{options[:gramos]}"
|
45
|
+
|
46
|
+
platos << aux
|
47
|
+
end
|
48
|
+
|
49
|
+
def porcent(options = {})
|
50
|
+
val = []
|
51
|
+
val << "#{options[:vct]}"
|
52
|
+
val << "#{options[:proteinas]}"
|
53
|
+
val << "#{options[:grasas]}"
|
54
|
+
val << "#{options[:hidratos]}"
|
55
|
+
|
56
|
+
porcentajes << val
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
def to_s
|
62
|
+
output = name
|
63
|
+
output << "\n#{'=' * name.size}\n\n"
|
64
|
+
output << "#{titulo} "
|
65
|
+
ingesta.each do |ingest|
|
66
|
+
output << "#{ingest}\n"
|
67
|
+
end
|
68
|
+
|
69
|
+
platos.each do |aux|
|
70
|
+
output << "- #{aux[0]}, #{aux[1]}, #{aux[2]}g\n"
|
71
|
+
end
|
72
|
+
|
73
|
+
porcentajes.each do |val|
|
74
|
+
output << "V.C.T. | % #{val[0]} kcal | #{val[1]}% - #{val[2]}% - #{val[3]}%\n"
|
75
|
+
end
|
76
|
+
|
77
|
+
output
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
# CÓDIGO DE PRÁCTICAS ANTERIORES, GUARDADOS POR SI LAS MOSCAS
|
88
|
+
#//////////////////////////////////////////////////////////////
|
89
|
+
# class Dieta
|
90
|
+
# include Comparable
|
91
|
+
# #Se tiene acceso de lectura y escritura a todos los atributos
|
92
|
+
# attr_accessor :descripcion, :titulo, :porcentaje, :porcion, :gramos, :vct, :p_proteina, :p_grasas, :p_hidratos
|
93
|
+
# def initialize(descripcion, titulo, porcentaje, porcion, gramos, vct, p_proteina, p_grasas, p_hidratos)
|
94
|
+
# @descripcion, @titulo, @porcentaje, @porcion, @gramos, @vct, @p_proteina, @p_grasas, @p_hidratos = descripcion, titulo, porcentaje, porcion, gramos, vct, p_proteina, p_grasas, p_hidratos
|
95
|
+
# end
|
96
|
+
|
97
|
+
|
98
|
+
# # Devuelve la referencia formateada del menú
|
99
|
+
# # TITULO (rango %)
|
100
|
+
# # -Descripcion del plato, porción recomendada de un plato, ingesta en gramos de un plato
|
101
|
+
# # V.C.T. | % [valor] kcal | [porcentaje_proteina] % - [porcentaje_grasas] % -[porcentaje_hidratos] %
|
102
|
+
# def to_s
|
103
|
+
# s = @titulo + " (" + @porcentaje + "%" + ")" + "\n"
|
104
|
+
# i=0;
|
105
|
+
# for i in 0..@descripcion.size-1
|
106
|
+
# s += "- " + "#{@descripcion[i]}" + ": " + "#{@porcion[i]}" + ", " + "#{@gramos[i]}g\n"
|
107
|
+
# end
|
108
|
+
|
109
|
+
# s+= "V.C.T | % " + @vct + "kcal | " + @p_proteina + "% - " + @p_grasas + "% - " + @p_hidratos + "%"
|
110
|
+
# s
|
111
|
+
# end
|
112
|
+
|
113
|
+
# def get_descripcion
|
114
|
+
# #Devuelve la descripcion del plato
|
115
|
+
# i=0;
|
116
|
+
# descrip= "#{@descripcion[i]}\n"
|
117
|
+
# for i in 1..@descripcion.size-1
|
118
|
+
# descrip += "#{@descripcion[i]}\n"
|
119
|
+
# end
|
120
|
+
# descrip
|
121
|
+
# end
|
122
|
+
|
123
|
+
# def get_titulo
|
124
|
+
# # Devuelve el título del menú
|
125
|
+
# "#{@titulo}"
|
126
|
+
# end
|
127
|
+
|
128
|
+
# def get_porcentaje
|
129
|
+
# # Devuelve el porcentaje de la ingesta diaria
|
130
|
+
# "(#{@porcentaje}%)"
|
131
|
+
# end
|
132
|
+
|
133
|
+
# def get_plato(i)
|
134
|
+
# # Devuelve un plato
|
135
|
+
# "- #{@descripcion[i]}" + ": " + "#{@porcion[i]}" + ", " + "#{@gramos[i]}g\n"
|
136
|
+
# end
|
137
|
+
|
138
|
+
# def get_cjto_platos
|
139
|
+
# # Devuelve un conjuntos de platos
|
140
|
+
# i=0;
|
141
|
+
# platos = "#{get_plato(i)}"
|
142
|
+
# for i in 1..@descripcion.size-1
|
143
|
+
# platos += "#{get_plato(i)}"
|
144
|
+
# end
|
145
|
+
# platos
|
146
|
+
# end
|
147
|
+
|
148
|
+
# def get_vct
|
149
|
+
# # Devuelve el vct
|
150
|
+
# "V.C.T | % " + "#{@vct}" + "kcal | "
|
151
|
+
# end
|
152
|
+
|
153
|
+
# def get_p_proteina
|
154
|
+
# # Devuelve porcentaje de proteinas de un conjunto de platos
|
155
|
+
# pro = @p_proteina + '%'
|
156
|
+
# pro
|
157
|
+
|
158
|
+
# end
|
159
|
+
|
160
|
+
# def get_p_grasas
|
161
|
+
# # Devuelve porcentaje de grasas de un conjunto de platos
|
162
|
+
# g = @p_grasas + '%'
|
163
|
+
# g
|
164
|
+
# end
|
165
|
+
|
166
|
+
# def get_p_hidratos
|
167
|
+
# # Devuelve porcentaje de hidratos de carbono de un conjunto de platos
|
168
|
+
# h = "#{@p_hidratos}" + '%'
|
169
|
+
# h
|
170
|
+
# end
|
171
|
+
# def <=> (other)
|
172
|
+
# @vct<=>other.vct
|
173
|
+
# end
|
174
|
+
# def ==(other)
|
175
|
+
# if(@vct==other.vct && @p_proteina==other.p_proteina && @p_grasas==other.p_grasas && @p_hidratos==other.p_hidratos)
|
176
|
+
# return true
|
177
|
+
# else
|
178
|
+
# return false
|
179
|
+
# end
|
180
|
+
# end
|
181
|
+
# end
|
182
|
+
|
183
|
+
# class Alimentos < Dieta
|
184
|
+
# def initialize (descripcion, titulo, porcentaje, porcion, gramos, vct, p_proteina, p_grasas, p_hidratos, grupo)
|
185
|
+
# super(descripcion, titulo, porcentaje, porcion, gramos, vct, p_proteina, p_grasas, p_hidratos)
|
186
|
+
# @grupo = grupo
|
187
|
+
# end
|
188
|
+
# def to_s
|
189
|
+
# dieta = "Dieta -> #{@grupo}\n"
|
190
|
+
# dieta += super.to_s
|
191
|
+
# "#{dieta}"
|
192
|
+
# end
|
193
|
+
|
194
|
+
# end
|
195
|
+
|
196
|
+
# class Edad < Dieta
|
197
|
+
# def initialize (descripcion, titulo, porcentaje, porcion, gramos, vct, p_proteina, p_grasas, p_hidratos, edad_from, edad_to)
|
198
|
+
# super(descripcion, titulo, porcentaje, porcion, gramos, vct, p_proteina, p_grasas, p_hidratos)
|
199
|
+
# @edad_from = edad_from
|
200
|
+
# @edad_to = edad_to
|
201
|
+
# end
|
202
|
+
# def to_s
|
203
|
+
# year = "Dieta -> De #{@edad_from}-#{@edad_to} años\n"
|
204
|
+
# year += super.to_s
|
205
|
+
# "#{year}"
|
206
|
+
# end
|
207
|
+
# end
|
@@ -0,0 +1,288 @@
|
|
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: Alimentos
|
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 = "Alimentos";
|
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 (A)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Alimentos</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: Alimentos
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
74
|
+
<span class="inheritName"><span class='object_link'><a href="Dieta.html" title="Dieta (class)">Dieta</a></span></span>
|
75
|
+
|
76
|
+
<ul class="fullTree">
|
77
|
+
<li>Object</li>
|
78
|
+
|
79
|
+
<li class="next"><span class='object_link'><a href="Dieta.html" title="Dieta (class)">Dieta</a></span></li>
|
80
|
+
|
81
|
+
<li class="next">Alimentos</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>Defined in:</dt>
|
101
|
+
<dd>dieta.rb</dd>
|
102
|
+
</dl>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<h2>Instance Attribute Summary</h2>
|
113
|
+
|
114
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Dieta.html" title="Dieta (class)">Dieta</a></span></h3>
|
115
|
+
<p class="inherited"><span class='object_link'><a href="Dieta.html#descripcion-instance_method" title="Dieta#descripcion (method)">#descripcion</a></span>, <span class='object_link'><a href="Dieta.html#gramos-instance_method" title="Dieta#gramos (method)">#gramos</a></span>, <span class='object_link'><a href="Dieta.html#p_grasas-instance_method" title="Dieta#p_grasas (method)">#p_grasas</a></span>, <span class='object_link'><a href="Dieta.html#p_hidratos-instance_method" title="Dieta#p_hidratos (method)">#p_hidratos</a></span>, <span class='object_link'><a href="Dieta.html#p_proteina-instance_method" title="Dieta#p_proteina (method)">#p_proteina</a></span>, <span class='object_link'><a href="Dieta.html#porcentaje-instance_method" title="Dieta#porcentaje (method)">#porcentaje</a></span>, <span class='object_link'><a href="Dieta.html#porcion-instance_method" title="Dieta#porcion (method)">#porcion</a></span>, <span class='object_link'><a href="Dieta.html#titulo-instance_method" title="Dieta#titulo (method)">#titulo</a></span>, <span class='object_link'><a href="Dieta.html#vct-instance_method" title="Dieta#vct (method)">#vct</a></span></p>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<h2>
|
120
|
+
Instance Method Summary
|
121
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
122
|
+
</h2>
|
123
|
+
|
124
|
+
<ul class="summary">
|
125
|
+
|
126
|
+
<li class="public ">
|
127
|
+
<span class="summary_signature">
|
128
|
+
|
129
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(descripcion, titulo, porcentaje, porcion, gramos, vct, p_proteina, p_grasas, p_hidratos, grupo) ⇒ Alimentos </a>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
</span>
|
134
|
+
|
135
|
+
|
136
|
+
<span class="note title constructor">constructor</span>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'>
|
146
|
+
<p>A new instance of Alimentos.</p>
|
147
|
+
</div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> ⇒ Object </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
170
|
+
|
171
|
+
</li>
|
172
|
+
|
173
|
+
|
174
|
+
</ul>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Dieta.html" title="Dieta (class)">Dieta</a></span></h3>
|
187
|
+
<p class="inherited"><span class='object_link'><a href="Dieta.html#%3C%3D%3E-instance_method" title="Dieta#<=> (method)">#<=></a></span>, <span class='object_link'><a href="Dieta.html#%3D%3D-instance_method" title="Dieta#== (method)">#==</a></span>, <span class='object_link'><a href="Dieta.html#get_cjto_platos-instance_method" title="Dieta#get_cjto_platos (method)">#get_cjto_platos</a></span>, <span class='object_link'><a href="Dieta.html#get_descripcion-instance_method" title="Dieta#get_descripcion (method)">#get_descripcion</a></span>, <span class='object_link'><a href="Dieta.html#get_p_grasas-instance_method" title="Dieta#get_p_grasas (method)">#get_p_grasas</a></span>, <span class='object_link'><a href="Dieta.html#get_p_hidratos-instance_method" title="Dieta#get_p_hidratos (method)">#get_p_hidratos</a></span>, <span class='object_link'><a href="Dieta.html#get_p_proteina-instance_method" title="Dieta#get_p_proteina (method)">#get_p_proteina</a></span>, <span class='object_link'><a href="Dieta.html#get_plato-instance_method" title="Dieta#get_plato (method)">#get_plato</a></span>, <span class='object_link'><a href="Dieta.html#get_porcentaje-instance_method" title="Dieta#get_porcentaje (method)">#get_porcentaje</a></span>, <span class='object_link'><a href="Dieta.html#get_titulo-instance_method" title="Dieta#get_titulo (method)">#get_titulo</a></span>, <span class='object_link'><a href="Dieta.html#get_vct-instance_method" title="Dieta#get_vct (method)">#get_vct</a></span></p>
|
188
|
+
|
189
|
+
<div id="constructor_details" class="method_details_list">
|
190
|
+
<h2>Constructor Details</h2>
|
191
|
+
|
192
|
+
<div class="method_details first">
|
193
|
+
<h3 class="signature first" id="initialize-instance_method">
|
194
|
+
|
195
|
+
#<strong>initialize</strong>(descripcion, titulo, porcentaje, porcion, gramos, vct, p_proteina, p_grasas, p_hidratos, grupo) ⇒ <tt><span class='object_link'><a href="" title="Alimentos (class)">Alimentos</a></span></tt>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
</h3><div class="docstring">
|
202
|
+
<div class="discussion">
|
203
|
+
|
204
|
+
<p>Returns a new instance of Alimentos</p>
|
205
|
+
|
206
|
+
|
207
|
+
</div>
|
208
|
+
</div>
|
209
|
+
<div class="tags">
|
210
|
+
|
211
|
+
|
212
|
+
</div><table class="source_code">
|
213
|
+
<tr>
|
214
|
+
<td>
|
215
|
+
<pre class="lines">
|
216
|
+
|
217
|
+
|
218
|
+
99
|
219
|
+
100
|
220
|
+
101
|
221
|
+
102</pre>
|
222
|
+
</td>
|
223
|
+
<td>
|
224
|
+
<pre class="code"><span class="info file"># File 'dieta.rb', line 99</span>
|
225
|
+
|
226
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='id identifier rubyid_descripcion'>descripcion</span><span class='comma'>,</span> <span class='id identifier rubyid_titulo'>titulo</span><span class='comma'>,</span> <span class='id identifier rubyid_porcentaje'>porcentaje</span><span class='comma'>,</span> <span class='id identifier rubyid_porcion'>porcion</span><span class='comma'>,</span> <span class='id identifier rubyid_gramos'>gramos</span><span class='comma'>,</span> <span class='id identifier rubyid_vct'>vct</span><span class='comma'>,</span> <span class='id identifier rubyid_p_proteina'>p_proteina</span><span class='comma'>,</span> <span class='id identifier rubyid_p_grasas'>p_grasas</span><span class='comma'>,</span> <span class='id identifier rubyid_p_hidratos'>p_hidratos</span><span class='comma'>,</span> <span class='id identifier rubyid_grupo'>grupo</span><span class='rparen'>)</span>
|
227
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_descripcion'>descripcion</span><span class='comma'>,</span> <span class='id identifier rubyid_titulo'>titulo</span><span class='comma'>,</span> <span class='id identifier rubyid_porcentaje'>porcentaje</span><span class='comma'>,</span> <span class='id identifier rubyid_porcion'>porcion</span><span class='comma'>,</span> <span class='id identifier rubyid_gramos'>gramos</span><span class='comma'>,</span> <span class='id identifier rubyid_vct'>vct</span><span class='comma'>,</span> <span class='id identifier rubyid_p_proteina'>p_proteina</span><span class='comma'>,</span> <span class='id identifier rubyid_p_grasas'>p_grasas</span><span class='comma'>,</span> <span class='id identifier rubyid_p_hidratos'>p_hidratos</span><span class='rparen'>)</span>
|
228
|
+
<span class='ivar'>@grupo</span> <span class='op'>=</span> <span class='id identifier rubyid_grupo'>grupo</span>
|
229
|
+
<span class='kw'>end</span></pre>
|
230
|
+
</td>
|
231
|
+
</tr>
|
232
|
+
</table>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
|
238
|
+
<div id="instance_method_details" class="method_details_list">
|
239
|
+
<h2>Instance Method Details</h2>
|
240
|
+
|
241
|
+
|
242
|
+
<div class="method_details first">
|
243
|
+
<h3 class="signature first" id="to_s-instance_method">
|
244
|
+
|
245
|
+
#<strong>to_s</strong> ⇒ <tt>Object</tt>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
</h3><table class="source_code">
|
252
|
+
<tr>
|
253
|
+
<td>
|
254
|
+
<pre class="lines">
|
255
|
+
|
256
|
+
|
257
|
+
103
|
258
|
+
104
|
259
|
+
105
|
260
|
+
106
|
261
|
+
107</pre>
|
262
|
+
</td>
|
263
|
+
<td>
|
264
|
+
<pre class="code"><span class="info file"># File 'dieta.rb', line 103</span>
|
265
|
+
|
266
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
267
|
+
<span class='id identifier rubyid_dieta'>dieta</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Dieta -> </span><span class='embexpr_beg'>#{</span><span class='ivar'>@grupo</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
268
|
+
<span class='id identifier rubyid_dieta'>dieta</span> <span class='op'>+=</span> <span class='kw'>super</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
269
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dieta'>dieta</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
270
|
+
<span class='kw'>end</span></pre>
|
271
|
+
</td>
|
272
|
+
</tr>
|
273
|
+
</table>
|
274
|
+
</div>
|
275
|
+
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div id="footer">
|
281
|
+
Generated on Tue Nov 22 19:31:08 2016 by
|
282
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
283
|
+
0.9.5 (ruby-2.1.5).
|
284
|
+
</div>
|
285
|
+
|
286
|
+
</div>
|
287
|
+
</body>
|
288
|
+
</html>
|