prct11_abian 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/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +56 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/Diet.html +1093 -0
- data/doc/DslDieta.html +1299 -0
- data/doc/LinkedList.html +1173 -0
- data/doc/MenuAge.html +461 -0
- data/doc/MenuFood.html +459 -0
- data/doc/Prct06.html +117 -0
- data/doc/_index.html +158 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +481 -0
- data/doc/file.README.html +104 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +104 -0
- data/doc/js/app.js +243 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +371 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/prct06/dslDieta.rb +64 -0
- data/lib/prct06/linkedList.rb +209 -0
- data/lib/prct06/menuAge.rb +42 -0
- data/lib/prct06/menuFood.rb +44 -0
- data/lib/prct06/prct06.rb +98 -0
- data/lib/prct06/version.rb +3 -0
- data/prct06.gemspec +39 -0
- metadata +169 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5a952892320c478a1acdf1d731db2fd0f1dc62d5
|
4
|
+
data.tar.gz: d275136b6482ce5d72134a029ec49566056820df
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c77344de9a79689b279030225e1237d31fbe12b50565ef0d87f96ed755967faac1eb38af1b406ef6640de3d46a48099d7e24ef7aecaa206c90b3270905534bc3
|
7
|
+
data.tar.gz: 28657a3e9fa12d9ab73c6c1085bf1bd3141369b7449d562c9946af6c5ddd4cd1371cad2253d711f08b58845f6869e41f4efd28d270cd913e21f909f3b2ddfcf9
|
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/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 alu0100887686
|
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,56 @@
|
|
1
|
+
# Prct11:
|
2
|
+
|
3
|
+
Creación de una clase en DslDieta para la representación de un DSL interno sobre dietas.
|
4
|
+
|
5
|
+
- Actualizaciones:
|
6
|
+
|
7
|
+
1. Creación de un DSL interno para la representación de dietas semanales y diarias.
|
8
|
+
2. Creación de nuestra gema.
|
9
|
+
|
10
|
+
##Desarrollada en segunda fase por:
|
11
|
+
|
12
|
+
- Abián Torres Torres
|
13
|
+
|
14
|
+
##Integrantes del grupo 55:
|
15
|
+
|
16
|
+
- Joaquín Sanchíz Navarro
|
17
|
+
- Abián Torres Torres
|
18
|
+
|
19
|
+
##Uso:
|
20
|
+
|
21
|
+
- Automatización de las pruebas mediante `rake` en cualquiera de los directorios del repositorio.
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "prct06"
|
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
data/doc/Diet.html
ADDED
@@ -0,0 +1,1093 @@
|
|
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/prct06/prct06.rb</dd>
|
105
|
+
</dl>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div id="subclasses">
|
110
|
+
<h2>Direct Known Subclasses</h2>
|
111
|
+
<p class="children"><span class='object_link'><a href="MenuAge.html" title="MenuAge (class)">MenuAge</a></span>, <span class='object_link'><a href="MenuFood.html" title="MenuFood (class)">MenuFood</a></span></p>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
118
|
+
<ul class="summary">
|
119
|
+
|
120
|
+
<li class="public ">
|
121
|
+
<span class="summary_signature">
|
122
|
+
|
123
|
+
<a href="#dip-instance_method" title="#M (instance method)">#<strong>M</strong> ⇒ Object </a>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
</span>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
141
|
+
|
142
|
+
</li>
|
143
|
+
|
144
|
+
|
145
|
+
<li class="public ">
|
146
|
+
<span class="summary_signature">
|
147
|
+
|
148
|
+
<a href="#pchdt-instance_method" title="#M (instance method)">#<strong>M</strong> ⇒ Object </a>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
</span>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
166
|
+
|
167
|
+
</li>
|
168
|
+
|
169
|
+
|
170
|
+
<li class="public ">
|
171
|
+
<span class="summary_signature">
|
172
|
+
|
173
|
+
<a href="#pfts-instance_method" title="#M (instance method)">#<strong>M</strong> ⇒ Object </a>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
</span>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
191
|
+
|
192
|
+
</li>
|
193
|
+
|
194
|
+
|
195
|
+
<li class="public ">
|
196
|
+
<span class="summary_signature">
|
197
|
+
|
198
|
+
<a href="#pprtn-instance_method" title="#M (instance method)">#<strong>M</strong> ⇒ Object </a>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
</span>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
216
|
+
|
217
|
+
</li>
|
218
|
+
|
219
|
+
|
220
|
+
<li class="public ">
|
221
|
+
<span class="summary_signature">
|
222
|
+
|
223
|
+
<a href="#rcps-instance_method" title="#M (instance method)">#<strong>M</strong> ⇒ Object </a>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
</span>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
241
|
+
|
242
|
+
</li>
|
243
|
+
|
244
|
+
|
245
|
+
<li class="public ">
|
246
|
+
<span class="summary_signature">
|
247
|
+
|
248
|
+
<a href="#ttl-instance_method" title="#M (instance method)">#<strong>M</strong> ⇒ Object </a>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
</span>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
266
|
+
|
267
|
+
</li>
|
268
|
+
|
269
|
+
|
270
|
+
<li class="public ">
|
271
|
+
<span class="summary_signature">
|
272
|
+
|
273
|
+
<a href="#vct-instance_method" title="#M (instance method)">#<strong>M</strong> ⇒ Object </a>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
</span>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
291
|
+
|
292
|
+
</li>
|
293
|
+
|
294
|
+
|
295
|
+
</ul>
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
<h2>
|
302
|
+
Instance Method Summary
|
303
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
304
|
+
</h2>
|
305
|
+
|
306
|
+
<ul class="summary">
|
307
|
+
|
308
|
+
<li class="public ">
|
309
|
+
<span class="summary_signature">
|
310
|
+
|
311
|
+
<a href="#%3C%3D%3E-instance_method" title="#<=> (instance method)">#<strong><=></strong>(other) ⇒ Int </a>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
</span>
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
<span class="summary_desc"><div class='inline'>
|
326
|
+
<p>1 if self>other, 0 if self == other, -1 if self<other.</p>
|
327
|
+
</div></span>
|
328
|
+
|
329
|
+
</li>
|
330
|
+
|
331
|
+
|
332
|
+
<li class="public ">
|
333
|
+
<span class="summary_signature">
|
334
|
+
|
335
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(ttl, dip, vct, pprtn, pfts, pchdt) ⇒ Diet </a>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
</span>
|
340
|
+
|
341
|
+
|
342
|
+
<span class="note title constructor">constructor</span>
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<span class="summary_desc"><div class='inline'>
|
352
|
+
<p>A new instance of Diet.</p>
|
353
|
+
</div></span>
|
354
|
+
|
355
|
+
</li>
|
356
|
+
|
357
|
+
|
358
|
+
<li class="public ">
|
359
|
+
<span class="summary_signature">
|
360
|
+
|
361
|
+
<a href="#new_recipe-instance_method" title="#new_recipe (instance method)">#<strong>new_recipe</strong>(recipe) ⇒ Object </a>
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
</span>
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
<span class="summary_desc"><div class='inline'>
|
376
|
+
<p>Con este método añadimos en el array un nuevo plato siguiendo el formato
|
377
|
+
predefinido.</p>
|
378
|
+
</div></span>
|
379
|
+
|
380
|
+
</li>
|
381
|
+
|
382
|
+
|
383
|
+
<li class="public ">
|
384
|
+
<span class="summary_signature">
|
385
|
+
|
386
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> ⇒ String </a>
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
</span>
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
<span class="summary_desc"><div class='inline'>
|
401
|
+
<p>String con el contenido de la lista.</p>
|
402
|
+
</div></span>
|
403
|
+
|
404
|
+
</li>
|
405
|
+
|
406
|
+
|
407
|
+
</ul>
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
<div id="constructor_details" class="method_details_list">
|
412
|
+
<h2>Constructor Details</h2>
|
413
|
+
|
414
|
+
<div class="method_details first">
|
415
|
+
<h3 class="signature first" id="initialize-instance_method">
|
416
|
+
|
417
|
+
#<strong>initialize</strong>(ttl, dip, vct, pprtn, pfts, pchdt) ⇒ <tt><span class='object_link'><a href="" title="Diet (class)">Diet</a></span></tt>
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
</h3><div class="docstring">
|
424
|
+
<div class="discussion">
|
425
|
+
|
426
|
+
<p>Returns a new instance of Diet</p>
|
427
|
+
|
428
|
+
|
429
|
+
</div>
|
430
|
+
</div>
|
431
|
+
<div class="tags">
|
432
|
+
<p class="tag_title">Parameters:</p>
|
433
|
+
<ul class="param">
|
434
|
+
|
435
|
+
<li>
|
436
|
+
|
437
|
+
<span class='name'>Título,</span>
|
438
|
+
|
439
|
+
|
440
|
+
<span class='type'>(<tt>String</tt>)</span>
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
—
|
445
|
+
<div class='inline'><dl class="rdoc-list label-list"><dt>String
|
446
|
+
<dd>
|
447
|
+
<p>Ingesta diaria, [String] Valor calorífico,</p>
|
448
|
+
</dd></dl>
|
449
|
+
</div>
|
450
|
+
|
451
|
+
</li>
|
452
|
+
|
453
|
+
<li>
|
454
|
+
|
455
|
+
<span class='name'>Porcentaje</span>
|
456
|
+
|
457
|
+
|
458
|
+
<span class='type'>(<tt>String</tt>)</span>
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
—
|
463
|
+
<div class='inline'>
|
464
|
+
<p>de proteínas, [String] Porcentaje de proteínas, [String] Porcentaje de
|
465
|
+
grasas</p>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
</li>
|
469
|
+
|
470
|
+
<li>
|
471
|
+
|
472
|
+
<span class='name'>Porcentaje</span>
|
473
|
+
|
474
|
+
|
475
|
+
<span class='type'>(<tt>String</tt>)</span>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
—
|
480
|
+
<div class='inline'>
|
481
|
+
<p>de hidratos de carbono</p>
|
482
|
+
</div>
|
483
|
+
|
484
|
+
</li>
|
485
|
+
|
486
|
+
</ul>
|
487
|
+
|
488
|
+
|
489
|
+
</div><table class="source_code">
|
490
|
+
<tr>
|
491
|
+
<td>
|
492
|
+
<pre class="lines">
|
493
|
+
|
494
|
+
|
495
|
+
34
|
496
|
+
35
|
497
|
+
36
|
498
|
+
37
|
499
|
+
38
|
500
|
+
39
|
501
|
+
40
|
502
|
+
41
|
503
|
+
42
|
504
|
+
43
|
505
|
+
44
|
506
|
+
45
|
507
|
+
46
|
508
|
+
47
|
509
|
+
48
|
510
|
+
49
|
511
|
+
50</pre>
|
512
|
+
</td>
|
513
|
+
<td>
|
514
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 34</span>
|
515
|
+
|
516
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_ttl'>ttl</span><span class='comma'>,</span><span class='id identifier rubyid_dip'>dip</span><span class='comma'>,</span><span class='id identifier rubyid_vct'>vct</span><span class='comma'>,</span><span class='id identifier rubyid_pprtn'>pprtn</span><span class='comma'>,</span><span class='id identifier rubyid_pfts'>pfts</span><span class='comma'>,</span><span class='id identifier rubyid_pchdt'>pchdt</span><span class='rparen'>)</span>
|
517
|
+
|
518
|
+
<span class='ivar'>@ttl</span> <span class='op'>=</span> <span class='id identifier rubyid_ttl'>ttl</span> <span class='comment'>#Título
|
519
|
+
</span>
|
520
|
+
<span class='ivar'>@dip</span> <span class='op'>=</span> <span class='id identifier rubyid_dip'>dip</span> <span class='comment'>#Ingesta Diaria
|
521
|
+
</span>
|
522
|
+
<span class='ivar'>@vct</span> <span class='op'>=</span> <span class='id identifier rubyid_vct'>vct</span> <span class='comment'>#Valor calorífico Total
|
523
|
+
</span>
|
524
|
+
<span class='ivar'>@rcps</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='comment'>#Array de platos
|
525
|
+
</span>
|
526
|
+
<span class='ivar'>@pprtn</span> <span class='op'>=</span> <span class='id identifier rubyid_pprtn'>pprtn</span> <span class='comment'>#Porcentaje de proteínas
|
527
|
+
</span>
|
528
|
+
<span class='ivar'>@pfts</span> <span class='op'>=</span> <span class='id identifier rubyid_pfts'>pfts</span> <span class='comment'>#Porcentaje de grasas
|
529
|
+
</span>
|
530
|
+
<span class='ivar'>@pchdt</span> <span class='op'>=</span> <span class='id identifier rubyid_pchdt'>pchdt</span> <span class='comment'>#Porcentaje de hidratos de carbono
|
531
|
+
</span>
|
532
|
+
<span class='kw'>end</span></pre>
|
533
|
+
</td>
|
534
|
+
</tr>
|
535
|
+
</table>
|
536
|
+
</div>
|
537
|
+
|
538
|
+
</div>
|
539
|
+
|
540
|
+
<div id="instance_attr_details" class="attr_details">
|
541
|
+
<h2>Instance Attribute Details</h2>
|
542
|
+
|
543
|
+
|
544
|
+
<span id="dip=-instance_method"></span>
|
545
|
+
<div class="method_details first">
|
546
|
+
<h3 class="signature first" id="dip-instance_method">
|
547
|
+
|
548
|
+
#<strong>M</strong> ⇒ <tt>Object</tt>
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
</h3><div class="docstring">
|
555
|
+
<div class="discussion">
|
556
|
+
|
557
|
+
|
558
|
+
</div>
|
559
|
+
</div>
|
560
|
+
<div class="tags">
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
</div><table class="source_code">
|
566
|
+
<tr>
|
567
|
+
<td>
|
568
|
+
<pre class="lines">
|
569
|
+
|
570
|
+
|
571
|
+
17
|
572
|
+
18
|
573
|
+
19</pre>
|
574
|
+
</td>
|
575
|
+
<td>
|
576
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 17</span>
|
577
|
+
|
578
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_dip'>dip</span>
|
579
|
+
<span class='ivar'>@dip</span>
|
580
|
+
<span class='kw'>end</span></pre>
|
581
|
+
</td>
|
582
|
+
</tr>
|
583
|
+
</table>
|
584
|
+
</div>
|
585
|
+
|
586
|
+
|
587
|
+
<span id="pchdt=-instance_method"></span>
|
588
|
+
<div class="method_details ">
|
589
|
+
<h3 class="signature " id="pchdt-instance_method">
|
590
|
+
|
591
|
+
#<strong>M</strong> ⇒ <tt>Object</tt>
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
</h3><div class="docstring">
|
598
|
+
<div class="discussion">
|
599
|
+
|
600
|
+
|
601
|
+
</div>
|
602
|
+
</div>
|
603
|
+
<div class="tags">
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
</div><table class="source_code">
|
609
|
+
<tr>
|
610
|
+
<td>
|
611
|
+
<pre class="lines">
|
612
|
+
|
613
|
+
|
614
|
+
27
|
615
|
+
28
|
616
|
+
29</pre>
|
617
|
+
</td>
|
618
|
+
<td>
|
619
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 27</span>
|
620
|
+
|
621
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pchdt'>pchdt</span>
|
622
|
+
<span class='ivar'>@pchdt</span>
|
623
|
+
<span class='kw'>end</span></pre>
|
624
|
+
</td>
|
625
|
+
</tr>
|
626
|
+
</table>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
|
630
|
+
<span id="pfts=-instance_method"></span>
|
631
|
+
<div class="method_details ">
|
632
|
+
<h3 class="signature " id="pfts-instance_method">
|
633
|
+
|
634
|
+
#<strong>M</strong> ⇒ <tt>Object</tt>
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
</h3><div class="docstring">
|
641
|
+
<div class="discussion">
|
642
|
+
|
643
|
+
|
644
|
+
</div>
|
645
|
+
</div>
|
646
|
+
<div class="tags">
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
</div><table class="source_code">
|
652
|
+
<tr>
|
653
|
+
<td>
|
654
|
+
<pre class="lines">
|
655
|
+
|
656
|
+
|
657
|
+
25
|
658
|
+
26
|
659
|
+
27</pre>
|
660
|
+
</td>
|
661
|
+
<td>
|
662
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 25</span>
|
663
|
+
|
664
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pfts'>pfts</span>
|
665
|
+
<span class='ivar'>@pfts</span>
|
666
|
+
<span class='kw'>end</span></pre>
|
667
|
+
</td>
|
668
|
+
</tr>
|
669
|
+
</table>
|
670
|
+
</div>
|
671
|
+
|
672
|
+
|
673
|
+
<span id="pprtn=-instance_method"></span>
|
674
|
+
<div class="method_details ">
|
675
|
+
<h3 class="signature " id="pprtn-instance_method">
|
676
|
+
|
677
|
+
#<strong>M</strong> ⇒ <tt>Object</tt>
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
</h3><div class="docstring">
|
684
|
+
<div class="discussion">
|
685
|
+
|
686
|
+
|
687
|
+
</div>
|
688
|
+
</div>
|
689
|
+
<div class="tags">
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
|
694
|
+
</div><table class="source_code">
|
695
|
+
<tr>
|
696
|
+
<td>
|
697
|
+
<pre class="lines">
|
698
|
+
|
699
|
+
|
700
|
+
23
|
701
|
+
24
|
702
|
+
25</pre>
|
703
|
+
</td>
|
704
|
+
<td>
|
705
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 23</span>
|
706
|
+
|
707
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pprtn'>pprtn</span>
|
708
|
+
<span class='ivar'>@pprtn</span>
|
709
|
+
<span class='kw'>end</span></pre>
|
710
|
+
</td>
|
711
|
+
</tr>
|
712
|
+
</table>
|
713
|
+
</div>
|
714
|
+
|
715
|
+
|
716
|
+
<span id="rcps=-instance_method"></span>
|
717
|
+
<div class="method_details ">
|
718
|
+
<h3 class="signature " id="rcps-instance_method">
|
719
|
+
|
720
|
+
#<strong>M</strong> ⇒ <tt>Object</tt>
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
|
726
|
+
</h3><div class="docstring">
|
727
|
+
<div class="discussion">
|
728
|
+
|
729
|
+
|
730
|
+
</div>
|
731
|
+
</div>
|
732
|
+
<div class="tags">
|
733
|
+
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
</div><table class="source_code">
|
738
|
+
<tr>
|
739
|
+
<td>
|
740
|
+
<pre class="lines">
|
741
|
+
|
742
|
+
|
743
|
+
21
|
744
|
+
22
|
745
|
+
23</pre>
|
746
|
+
</td>
|
747
|
+
<td>
|
748
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 21</span>
|
749
|
+
|
750
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_rcps'>rcps</span>
|
751
|
+
<span class='ivar'>@rcps</span>
|
752
|
+
<span class='kw'>end</span></pre>
|
753
|
+
</td>
|
754
|
+
</tr>
|
755
|
+
</table>
|
756
|
+
</div>
|
757
|
+
|
758
|
+
|
759
|
+
<span id="ttl=-instance_method"></span>
|
760
|
+
<div class="method_details ">
|
761
|
+
<h3 class="signature " id="ttl-instance_method">
|
762
|
+
|
763
|
+
#<strong>M</strong> ⇒ <tt>Object</tt>
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
|
768
|
+
|
769
|
+
</h3><div class="docstring">
|
770
|
+
<div class="discussion">
|
771
|
+
|
772
|
+
|
773
|
+
</div>
|
774
|
+
</div>
|
775
|
+
<div class="tags">
|
776
|
+
|
777
|
+
|
778
|
+
|
779
|
+
|
780
|
+
</div><table class="source_code">
|
781
|
+
<tr>
|
782
|
+
<td>
|
783
|
+
<pre class="lines">
|
784
|
+
|
785
|
+
|
786
|
+
15
|
787
|
+
16
|
788
|
+
17</pre>
|
789
|
+
</td>
|
790
|
+
<td>
|
791
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 15</span>
|
792
|
+
|
793
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ttl'>ttl</span>
|
794
|
+
<span class='ivar'>@ttl</span>
|
795
|
+
<span class='kw'>end</span></pre>
|
796
|
+
</td>
|
797
|
+
</tr>
|
798
|
+
</table>
|
799
|
+
</div>
|
800
|
+
|
801
|
+
|
802
|
+
<span id="vct=-instance_method"></span>
|
803
|
+
<div class="method_details ">
|
804
|
+
<h3 class="signature " id="vct-instance_method">
|
805
|
+
|
806
|
+
#<strong>M</strong> ⇒ <tt>Object</tt>
|
807
|
+
|
808
|
+
|
809
|
+
|
810
|
+
|
811
|
+
|
812
|
+
</h3><div class="docstring">
|
813
|
+
<div class="discussion">
|
814
|
+
|
815
|
+
|
816
|
+
</div>
|
817
|
+
</div>
|
818
|
+
<div class="tags">
|
819
|
+
|
820
|
+
|
821
|
+
|
822
|
+
|
823
|
+
</div><table class="source_code">
|
824
|
+
<tr>
|
825
|
+
<td>
|
826
|
+
<pre class="lines">
|
827
|
+
|
828
|
+
|
829
|
+
19
|
830
|
+
20
|
831
|
+
21</pre>
|
832
|
+
</td>
|
833
|
+
<td>
|
834
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 19</span>
|
835
|
+
|
836
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_vct'>vct</span>
|
837
|
+
<span class='ivar'>@vct</span>
|
838
|
+
<span class='kw'>end</span></pre>
|
839
|
+
</td>
|
840
|
+
</tr>
|
841
|
+
</table>
|
842
|
+
</div>
|
843
|
+
|
844
|
+
</div>
|
845
|
+
|
846
|
+
|
847
|
+
<div id="instance_method_details" class="method_details_list">
|
848
|
+
<h2>Instance Method Details</h2>
|
849
|
+
|
850
|
+
|
851
|
+
<div class="method_details first">
|
852
|
+
<h3 class="signature first" id="<=>-instance_method">
|
853
|
+
|
854
|
+
#<strong><=></strong>(other) ⇒ <tt>Int</tt>
|
855
|
+
|
856
|
+
|
857
|
+
|
858
|
+
|
859
|
+
|
860
|
+
</h3><div class="docstring">
|
861
|
+
<div class="discussion">
|
862
|
+
|
863
|
+
<div class="note notetag">
|
864
|
+
<strong>Note:</strong>
|
865
|
+
<div class='inline'>
|
866
|
+
<p>Función que permite comparar dos dietas en función de sus valor calorífico.</p>
|
867
|
+
</div>
|
868
|
+
</div>
|
869
|
+
|
870
|
+
|
871
|
+
<p>Returns 1 if self>other, 0 if self == other, -1 if self<other</p>
|
872
|
+
|
873
|
+
|
874
|
+
</div>
|
875
|
+
</div>
|
876
|
+
<div class="tags">
|
877
|
+
<p class="tag_title">Parameters:</p>
|
878
|
+
<ul class="param">
|
879
|
+
|
880
|
+
<li>
|
881
|
+
|
882
|
+
<span class='name'>Menú</span>
|
883
|
+
|
884
|
+
|
885
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Diet (class)">Diet</a></span></tt>)</span>
|
886
|
+
|
887
|
+
|
888
|
+
|
889
|
+
—
|
890
|
+
<div class='inline'>
|
891
|
+
<p>a comparar</p>
|
892
|
+
</div>
|
893
|
+
|
894
|
+
</li>
|
895
|
+
|
896
|
+
</ul>
|
897
|
+
|
898
|
+
<p class="tag_title">Returns:</p>
|
899
|
+
<ul class="return">
|
900
|
+
|
901
|
+
<li>
|
902
|
+
|
903
|
+
|
904
|
+
<span class='type'>(<tt>Int</tt>)</span>
|
905
|
+
|
906
|
+
|
907
|
+
|
908
|
+
—
|
909
|
+
<div class='inline'>
|
910
|
+
<p>1 if self>other, 0 if self == other, -1 if self<other</p>
|
911
|
+
</div>
|
912
|
+
|
913
|
+
</li>
|
914
|
+
|
915
|
+
</ul>
|
916
|
+
|
917
|
+
</div><table class="source_code">
|
918
|
+
<tr>
|
919
|
+
<td>
|
920
|
+
<pre class="lines">
|
921
|
+
|
922
|
+
|
923
|
+
92
|
924
|
+
93
|
925
|
+
94
|
926
|
+
95
|
927
|
+
96</pre>
|
928
|
+
</td>
|
929
|
+
<td>
|
930
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 92</span>
|
931
|
+
|
932
|
+
<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>
|
933
|
+
|
934
|
+
<span class='ivar'>@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>
|
935
|
+
|
936
|
+
<span class='kw'>end</span></pre>
|
937
|
+
</td>
|
938
|
+
</tr>
|
939
|
+
</table>
|
940
|
+
</div>
|
941
|
+
|
942
|
+
<div class="method_details ">
|
943
|
+
<h3 class="signature " id="new_recipe-instance_method">
|
944
|
+
|
945
|
+
#<strong>new_recipe</strong>(recipe) ⇒ <tt>Object</tt>
|
946
|
+
|
947
|
+
|
948
|
+
|
949
|
+
|
950
|
+
|
951
|
+
</h3><div class="docstring">
|
952
|
+
<div class="discussion">
|
953
|
+
|
954
|
+
<p>Con este método añadimos en el array un nuevo plato siguiendo el formato
|
955
|
+
predefinido.</p>
|
956
|
+
|
957
|
+
|
958
|
+
</div>
|
959
|
+
</div>
|
960
|
+
<div class="tags">
|
961
|
+
|
962
|
+
|
963
|
+
</div><table class="source_code">
|
964
|
+
<tr>
|
965
|
+
<td>
|
966
|
+
<pre class="lines">
|
967
|
+
|
968
|
+
|
969
|
+
80
|
970
|
+
81
|
971
|
+
82
|
972
|
+
83
|
973
|
+
84
|
974
|
+
85
|
975
|
+
86</pre>
|
976
|
+
</td>
|
977
|
+
<td>
|
978
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 80</span>
|
979
|
+
|
980
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_new_recipe'>new_recipe</span><span class='lparen'>(</span><span class='id identifier rubyid_recipe'>recipe</span><span class='rparen'>)</span>
|
981
|
+
|
982
|
+
<span class='id identifier rubyid_tmp'>tmp</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_recipe'>recipe</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
983
|
+
|
984
|
+
<span class='id identifier rubyid_rcps'>rcps</span> <span class='op'><<</span> <span class='id identifier rubyid_tmp'>tmp</span>
|
985
|
+
|
986
|
+
<span class='kw'>end</span></pre>
|
987
|
+
</td>
|
988
|
+
</tr>
|
989
|
+
</table>
|
990
|
+
</div>
|
991
|
+
|
992
|
+
<div class="method_details ">
|
993
|
+
<h3 class="signature " id="to_s-instance_method">
|
994
|
+
|
995
|
+
#<strong>to_s</strong> ⇒ <tt>String</tt>
|
996
|
+
|
997
|
+
|
998
|
+
|
999
|
+
|
1000
|
+
|
1001
|
+
</h3><div class="docstring">
|
1002
|
+
<div class="discussion">
|
1003
|
+
|
1004
|
+
<p>Returns String con el contenido de la lista</p>
|
1005
|
+
|
1006
|
+
|
1007
|
+
</div>
|
1008
|
+
</div>
|
1009
|
+
<div class="tags">
|
1010
|
+
|
1011
|
+
<p class="tag_title">Returns:</p>
|
1012
|
+
<ul class="return">
|
1013
|
+
|
1014
|
+
<li>
|
1015
|
+
|
1016
|
+
|
1017
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1018
|
+
|
1019
|
+
|
1020
|
+
|
1021
|
+
—
|
1022
|
+
<div class='inline'>
|
1023
|
+
<p>String con el contenido de la lista</p>
|
1024
|
+
</div>
|
1025
|
+
|
1026
|
+
</li>
|
1027
|
+
|
1028
|
+
</ul>
|
1029
|
+
|
1030
|
+
</div><table class="source_code">
|
1031
|
+
<tr>
|
1032
|
+
<td>
|
1033
|
+
<pre class="lines">
|
1034
|
+
|
1035
|
+
|
1036
|
+
55
|
1037
|
+
56
|
1038
|
+
57
|
1039
|
+
58
|
1040
|
+
59
|
1041
|
+
60
|
1042
|
+
61
|
1043
|
+
62
|
1044
|
+
63
|
1045
|
+
64
|
1046
|
+
65
|
1047
|
+
66
|
1048
|
+
67
|
1049
|
+
68
|
1050
|
+
69
|
1051
|
+
70
|
1052
|
+
71
|
1053
|
+
72</pre>
|
1054
|
+
</td>
|
1055
|
+
<td>
|
1056
|
+
<pre class="code"><span class="info file"># File 'lib/prct06/prct06.rb', line 55</span>
|
1057
|
+
|
1058
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
1059
|
+
|
1060
|
+
<span class='id identifier rubyid_tmp'>tmp</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ttl'>ttl</span><span class='embexpr_end'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dip'>dip</span><span class='embexpr_end'>}</span><span class='tstring_content'>%)\n</span><span class='tstring_end'>"</span></span>
|
1061
|
+
|
1062
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='int'>0</span>
|
1063
|
+
|
1064
|
+
<span class='kw'>begin</span>
|
1065
|
+
|
1066
|
+
<span class='id identifier rubyid_tmp'>tmp</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rcps'>rcps</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1067
|
+
|
1068
|
+
<span class='id identifier rubyid_i'>i</span><span class='op'>+=</span><span class='int'>1</span>
|
1069
|
+
|
1070
|
+
<span class='kw'>end</span> <span class='kw'>while</span> <span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span><span class='op'><</span><span class='id identifier rubyid_rcps'>rcps</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rparen'>)</span>
|
1071
|
+
|
1072
|
+
<span class='id identifier rubyid_tmp'>tmp</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_pprtn'>pprtn</span><span class='embexpr_end'>}</span><span class='tstring_content'>% - </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_pfts'>pfts</span><span class='embexpr_end'>}</span><span class='tstring_content'>% - </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_pchdt'>pchdt</span><span class='embexpr_end'>}</span><span class='tstring_content'>%\n</span><span class='tstring_end'>"</span></span>
|
1073
|
+
|
1074
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tmp'>tmp</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1075
|
+
<span class='kw'>end</span></pre>
|
1076
|
+
</td>
|
1077
|
+
</tr>
|
1078
|
+
</table>
|
1079
|
+
</div>
|
1080
|
+
|
1081
|
+
</div>
|
1082
|
+
|
1083
|
+
</div>
|
1084
|
+
|
1085
|
+
<div id="footer">
|
1086
|
+
Generated on Tue Dec 13 16:00:37 2016 by
|
1087
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1088
|
+
0.9.5 (ruby-2.3.0).
|
1089
|
+
</div>
|
1090
|
+
|
1091
|
+
</div>
|
1092
|
+
</body>
|
1093
|
+
</html>
|