prct06_alu0100948097 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1e20da0dfb55071987cd6222b8738e0b779f2a45
4
+ data.tar.gz: a85cb7a89940d5542fb16df0b08ad10110955720
5
+ SHA512:
6
+ metadata.gz: c73c2e7e17e059da6863f7c31f727551151b0fadd98829292776a9d2739c76f94d3534c4c5ccb585755dbaf889f976c88418220d3724719134a80a14f4cfee2c
7
+ data.tar.gz: 5b898d6b4897f8d41cee4ca98fe7d5e3e2655ec4bd6c97e98d0620cd589ad4f8b070f49e09a9fb77c99c880d8e9a8e448d3779f8e1033e65b4bd1ad4d9cb83d7
data/.DS_Store ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.*/
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ - 2.3.0
6
+ before_install: gem install bundler -v 1.15.4
@@ -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 alu0100948097@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
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100948097.git" }
4
+
5
+ # Specify your gem's dependencies in prct06.gemspec
6
+ gemspec
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) 2017 Sergio Ferrera de Diego
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,3 @@
1
+ Práctica de Laboratorio #10. Programación Funcional. Benchmarks.
2
+
3
+ Autor: SERGIO FERRERA DE DIEGO
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
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(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,1033 @@
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
+ &mdash; Documentation by YARD 0.9.12
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?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (A)</a> &raquo;
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
+ <div id="content"><h1>Class: Alimentos
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Alimentos</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <dl>
91
+ <dt>Includes:</dt>
92
+ <dd>Comparable</dd>
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>lib/prct06/alimentos.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+ <h2>Overview</h2><div class="docstring">
108
+ <div class="discussion">
109
+
110
+ <p>Esta clase permite representar alimentos con sus distintos
111
+ macronutrientres. Su desarrollo ha sido dirigido por pruebas (TDD). Se han
112
+ incluido el mixin Comparable</p>
113
+ <dl class="rdoc-list note-list"><dt>Author
114
+ <dd>
115
+ <p>Sergio Ferrera de Diego (<a
116
+ href="mailto:sergioferrera1296@gmail.com">sergioferrera1296@gmail.com</a>)</p>
117
+ </dd><dt>Copyright
118
+ <dd>
119
+ <p>Cretive Commons</p>
120
+ </dd><dt>License
121
+ <dd>
122
+ <p>Distributes under the same terms as Ruby</p>
123
+ </dd></dl>
124
+
125
+
126
+ </div>
127
+ </div>
128
+ <div class="tags">
129
+
130
+
131
+ </div><div id="subclasses">
132
+ <h2>Direct Known Subclasses</h2>
133
+ <p class="children"><span class='object_link'><a href="G_alimentos.html" title="G_alimentos (class)">G_alimentos</a></span></p>
134
+ </div>
135
+
136
+
137
+
138
+
139
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
140
+ <ul class="summary">
141
+
142
+ <li class="public ">
143
+ <span class="summary_signature">
144
+
145
+ <a href="#alimento-instance_method" title="#alimento (instance method)">#<strong>alimento</strong> &#x21d2; Object </a>
146
+
147
+
148
+
149
+ </span>
150
+
151
+
152
+
153
+
154
+ <span class="note title readonly">readonly</span>
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+ <span class="summary_desc"><div class='inline'>
165
+ <p>Returns the value of attribute alimento.</p>
166
+ </div></span>
167
+
168
+ </li>
169
+
170
+
171
+ <li class="public ">
172
+ <span class="summary_signature">
173
+
174
+ <a href="#g-instance_method" title="#g (instance method)">#<strong>g</strong> &#x21d2; Object </a>
175
+
176
+
177
+
178
+ </span>
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+ <span class="summary_desc"><div class='inline'>
192
+ <p>Returns the value of attribute g.</p>
193
+ </div></span>
194
+
195
+ </li>
196
+
197
+
198
+ <li class="public ">
199
+ <span class="summary_signature">
200
+
201
+ <a href="#glucidos-instance_method" title="#glucidos (instance method)">#<strong>glucidos</strong> &#x21d2; Object </a>
202
+
203
+
204
+
205
+ </span>
206
+
207
+
208
+
209
+
210
+ <span class="note title readonly">readonly</span>
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+ <span class="summary_desc"><div class='inline'>
221
+ <p>Returns the value of attribute glucidos.</p>
222
+ </div></span>
223
+
224
+ </li>
225
+
226
+
227
+ <li class="public ">
228
+ <span class="summary_signature">
229
+
230
+ <a href="#grasas-instance_method" title="#grasas (instance method)">#<strong>grasas</strong> &#x21d2; Object </a>
231
+
232
+
233
+
234
+ </span>
235
+
236
+
237
+
238
+
239
+ <span class="note title readonly">readonly</span>
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+ <span class="summary_desc"><div class='inline'>
250
+ <p>Returns the value of attribute grasas.</p>
251
+ </div></span>
252
+
253
+ </li>
254
+
255
+
256
+ <li class="public ">
257
+ <span class="summary_signature">
258
+
259
+ <a href="#proteinas-instance_method" title="#proteinas (instance method)">#<strong>proteinas</strong> &#x21d2; Object </a>
260
+
261
+
262
+
263
+ </span>
264
+
265
+
266
+
267
+
268
+ <span class="note title readonly">readonly</span>
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+ <span class="summary_desc"><div class='inline'>
279
+ <p>Returns the value of attribute proteinas.</p>
280
+ </div></span>
281
+
282
+ </li>
283
+
284
+
285
+ </ul>
286
+
287
+
288
+
289
+
290
+
291
+ <h2>
292
+ Instance Method Summary
293
+ <small><a href="#" class="summary_toggle">collapse</a></small>
294
+ </h2>
295
+
296
+ <ul class="summary">
297
+
298
+ <li class="public ">
299
+ <span class="summary_signature">
300
+
301
+ <a href="#<=>-instance_method" title="#&lt;=&gt; (instance method)">#<strong>&lt;=&gt;</strong>(other) &#x21d2; Object </a>
302
+
303
+
304
+
305
+ </span>
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+ <span class="summary_desc"><div class='inline'>
316
+ <p>Método para definir la forma en la que comparar instancias de la clase.</p>
317
+ </div></span>
318
+
319
+ </li>
320
+
321
+
322
+ <li class="public ">
323
+ <span class="summary_signature">
324
+
325
+ <a href="#==-instance_method" title="#== (instance method)">#<strong>==</strong>(other) &#x21d2; Object </a>
326
+
327
+
328
+
329
+ </span>
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+ <span class="summary_desc"><div class='inline'></div></span>
340
+
341
+ </li>
342
+
343
+
344
+ <li class="public ">
345
+ <span class="summary_signature">
346
+
347
+ <a href="#AIBC-instance_method" title="#AIBC (instance method)">#<strong>AIBC</strong> &#x21d2; Object </a>
348
+
349
+
350
+
351
+ </span>
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+ <span class="summary_desc"><div class='inline'>
362
+ <p>Método para calcular el Área incremental bajo la curva (AIBC) de un
363
+ alimento o glucosa, dependiendo de que se le pase por parametro.</p>
364
+ </div></span>
365
+
366
+ </li>
367
+
368
+
369
+ <li class="public ">
370
+ <span class="summary_signature">
371
+
372
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(alimento, proteinas, glucidos, grasas) &#x21d2; Alimentos </a>
373
+
374
+
375
+
376
+ </span>
377
+
378
+
379
+ <span class="note title constructor">constructor</span>
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+ <span class="summary_desc"><div class='inline'>
389
+ <p>Método para asignar los datos del alimento.</p>
390
+ </div></span>
391
+
392
+ </li>
393
+
394
+
395
+ <li class="public ">
396
+ <span class="summary_signature">
397
+
398
+ <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; Object </a>
399
+
400
+
401
+
402
+ </span>
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+ <span class="summary_desc"><div class='inline'>
413
+ <p>Método para definir la forma en la que mostrar los datos del alimento.</p>
414
+ </div></span>
415
+
416
+ </li>
417
+
418
+
419
+ <li class="public ">
420
+ <span class="summary_signature">
421
+
422
+ <a href="#valor_ener-instance_method" title="#valor_ener (instance method)">#<strong>valor_ener</strong> &#x21d2; Object </a>
423
+
424
+
425
+
426
+ </span>
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+ <span class="summary_desc"><div class='inline'>
437
+ <p>Método para calcular el valor energetico del alimento.</p>
438
+ </div></span>
439
+
440
+ </li>
441
+
442
+
443
+ </ul>
444
+
445
+
446
+
447
+ <div id="constructor_details" class="method_details_list">
448
+ <h2>Constructor Details</h2>
449
+
450
+ <div class="method_details first">
451
+ <h3 class="signature first" id="initialize-instance_method">
452
+
453
+ #<strong>initialize</strong>(alimento, proteinas, glucidos, grasas) &#x21d2; <tt><span class='object_link'><a href="" title="Alimentos (class)">Alimentos</a></span></tt>
454
+
455
+
456
+
457
+
458
+
459
+ </h3><div class="docstring">
460
+ <div class="discussion">
461
+
462
+ <p>Método para asignar los datos del alimento</p>
463
+
464
+
465
+ </div>
466
+ </div>
467
+ <div class="tags">
468
+ <p class="tag_title">Parameters:</p>
469
+ <ul class="param">
470
+
471
+ <li>
472
+
473
+ <span class='name'>alimento</span>
474
+
475
+
476
+ <span class='type'></span>
477
+
478
+
479
+
480
+ &mdash;
481
+ <div class='inline'>
482
+ <p>nombre del alimento</p>
483
+ </div>
484
+
485
+ </li>
486
+
487
+ <li>
488
+
489
+ <span class='name'>proteinas</span>
490
+
491
+
492
+ <span class='type'></span>
493
+
494
+
495
+
496
+ &mdash;
497
+ <div class='inline'>
498
+ <p>cantidad de proteinas del alimento</p>
499
+ </div>
500
+
501
+ </li>
502
+
503
+ <li>
504
+
505
+ <span class='name'>glucidos</span>
506
+
507
+
508
+ <span class='type'></span>
509
+
510
+
511
+
512
+ &mdash;
513
+ <div class='inline'>
514
+ <p>cantidad de glucidos del alimento</p>
515
+ </div>
516
+
517
+ </li>
518
+
519
+ <li>
520
+
521
+ <span class='name'>grasas</span>
522
+
523
+
524
+ <span class='type'></span>
525
+
526
+
527
+
528
+ &mdash;
529
+ <div class='inline'>
530
+ <p>cantidad de grasas del alimento</p>
531
+ </div>
532
+
533
+ </li>
534
+
535
+ </ul>
536
+
537
+
538
+ </div><table class="source_code">
539
+ <tr>
540
+ <td>
541
+ <pre class="lines">
542
+
543
+
544
+ 33
545
+ 34
546
+ 35
547
+ 36
548
+ 37
549
+ 38</pre>
550
+ </td>
551
+ <td>
552
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 33</span>
553
+
554
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_alimento'>alimento</span><span class='comma'>,</span><span class='id identifier rubyid_proteinas'>proteinas</span><span class='comma'>,</span><span class='id identifier rubyid_glucidos'>glucidos</span><span class='comma'>,</span><span class='id identifier rubyid_grasas'>grasas</span><span class='rparen'>)</span>
555
+ <span class='ivar'>@alimento</span> <span class='op'>=</span> <span class='id identifier rubyid_alimento'>alimento</span>
556
+ <span class='ivar'>@proteinas</span> <span class='op'>=</span> <span class='id identifier rubyid_proteinas'>proteinas</span>
557
+ <span class='ivar'>@glucidos</span> <span class='op'>=</span> <span class='id identifier rubyid_glucidos'>glucidos</span>
558
+ <span class='ivar'>@grasas</span> <span class='op'>=</span> <span class='id identifier rubyid_grasas'>grasas</span>
559
+ <span class='kw'>end</span></pre>
560
+ </td>
561
+ </tr>
562
+ </table>
563
+ </div>
564
+
565
+ </div>
566
+
567
+ <div id="instance_attr_details" class="attr_details">
568
+ <h2>Instance Attribute Details</h2>
569
+
570
+
571
+ <span id=""></span>
572
+ <div class="method_details first">
573
+ <h3 class="signature first" id="alimento-instance_method">
574
+
575
+ #<strong>alimento</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
576
+
577
+
578
+
579
+
580
+
581
+ </h3><div class="docstring">
582
+ <div class="discussion">
583
+
584
+ <p>Returns the value of attribute alimento</p>
585
+
586
+
587
+ </div>
588
+ </div>
589
+ <div class="tags">
590
+
591
+
592
+ </div><table class="source_code">
593
+ <tr>
594
+ <td>
595
+ <pre class="lines">
596
+
597
+
598
+ 14
599
+ 15
600
+ 16</pre>
601
+ </td>
602
+ <td>
603
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 14</span>
604
+
605
+ <span class='kw'>def</span> <span class='id identifier rubyid_alimento'>alimento</span>
606
+ <span class='ivar'>@alimento</span>
607
+ <span class='kw'>end</span></pre>
608
+ </td>
609
+ </tr>
610
+ </table>
611
+ </div>
612
+
613
+
614
+ <span id="g=-instance_method"></span>
615
+ <div class="method_details ">
616
+ <h3 class="signature " id="g-instance_method">
617
+
618
+ #<strong>g</strong> &#x21d2; <tt>Object</tt>
619
+
620
+
621
+
622
+
623
+
624
+ </h3><div class="docstring">
625
+ <div class="discussion">
626
+
627
+ <p>Returns the value of attribute g</p>
628
+
629
+
630
+ </div>
631
+ </div>
632
+ <div class="tags">
633
+
634
+
635
+ </div><table class="source_code">
636
+ <tr>
637
+ <td>
638
+ <pre class="lines">
639
+
640
+
641
+ 16
642
+ 17
643
+ 18</pre>
644
+ </td>
645
+ <td>
646
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 16</span>
647
+
648
+ <span class='kw'>def</span> <span class='id identifier rubyid_g'>g</span>
649
+ <span class='ivar'>@g</span>
650
+ <span class='kw'>end</span></pre>
651
+ </td>
652
+ </tr>
653
+ </table>
654
+ </div>
655
+
656
+
657
+ <span id=""></span>
658
+ <div class="method_details ">
659
+ <h3 class="signature " id="glucidos-instance_method">
660
+
661
+ #<strong>glucidos</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
662
+
663
+
664
+
665
+
666
+
667
+ </h3><div class="docstring">
668
+ <div class="discussion">
669
+
670
+ <p>Returns the value of attribute glucidos</p>
671
+
672
+
673
+ </div>
674
+ </div>
675
+ <div class="tags">
676
+
677
+
678
+ </div><table class="source_code">
679
+ <tr>
680
+ <td>
681
+ <pre class="lines">
682
+
683
+
684
+ 14
685
+ 15
686
+ 16</pre>
687
+ </td>
688
+ <td>
689
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 14</span>
690
+
691
+ <span class='kw'>def</span> <span class='id identifier rubyid_glucidos'>glucidos</span>
692
+ <span class='ivar'>@glucidos</span>
693
+ <span class='kw'>end</span></pre>
694
+ </td>
695
+ </tr>
696
+ </table>
697
+ </div>
698
+
699
+
700
+ <span id=""></span>
701
+ <div class="method_details ">
702
+ <h3 class="signature " id="grasas-instance_method">
703
+
704
+ #<strong>grasas</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
705
+
706
+
707
+
708
+
709
+
710
+ </h3><div class="docstring">
711
+ <div class="discussion">
712
+
713
+ <p>Returns the value of attribute grasas</p>
714
+
715
+
716
+ </div>
717
+ </div>
718
+ <div class="tags">
719
+
720
+
721
+ </div><table class="source_code">
722
+ <tr>
723
+ <td>
724
+ <pre class="lines">
725
+
726
+
727
+ 14
728
+ 15
729
+ 16</pre>
730
+ </td>
731
+ <td>
732
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 14</span>
733
+
734
+ <span class='kw'>def</span> <span class='id identifier rubyid_grasas'>grasas</span>
735
+ <span class='ivar'>@grasas</span>
736
+ <span class='kw'>end</span></pre>
737
+ </td>
738
+ </tr>
739
+ </table>
740
+ </div>
741
+
742
+
743
+ <span id=""></span>
744
+ <div class="method_details ">
745
+ <h3 class="signature " id="proteinas-instance_method">
746
+
747
+ #<strong>proteinas</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
748
+
749
+
750
+
751
+
752
+
753
+ </h3><div class="docstring">
754
+ <div class="discussion">
755
+
756
+ <p>Returns the value of attribute proteinas</p>
757
+
758
+
759
+ </div>
760
+ </div>
761
+ <div class="tags">
762
+
763
+
764
+ </div><table class="source_code">
765
+ <tr>
766
+ <td>
767
+ <pre class="lines">
768
+
769
+
770
+ 14
771
+ 15
772
+ 16</pre>
773
+ </td>
774
+ <td>
775
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 14</span>
776
+
777
+ <span class='kw'>def</span> <span class='id identifier rubyid_proteinas'>proteinas</span>
778
+ <span class='ivar'>@proteinas</span>
779
+ <span class='kw'>end</span></pre>
780
+ </td>
781
+ </tr>
782
+ </table>
783
+ </div>
784
+
785
+ </div>
786
+
787
+
788
+ <div id="instance_method_details" class="method_details_list">
789
+ <h2>Instance Method Details</h2>
790
+
791
+
792
+ <div class="method_details first">
793
+ <h3 class="signature first" id="<=>-instance_method">
794
+
795
+ #<strong>&lt;=&gt;</strong>(other) &#x21d2; <tt>Object</tt>
796
+
797
+
798
+
799
+
800
+
801
+ </h3><div class="docstring">
802
+ <div class="discussion">
803
+
804
+ <p>Método para definir la forma en la que comparar instancias de la clase</p>
805
+
806
+
807
+ </div>
808
+ </div>
809
+ <div class="tags">
810
+
811
+
812
+ </div><table class="source_code">
813
+ <tr>
814
+ <td>
815
+ <pre class="lines">
816
+
817
+
818
+ 19
819
+ 20
820
+ 21</pre>
821
+ </td>
822
+ <td>
823
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 19</span>
824
+
825
+ <span class='kw'>def</span> <span class='op'>&lt;=&gt;</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
826
+ <span class='id identifier rubyid_valor_ener'>valor_ener</span> <span class='op'>&lt;=&gt;</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_valor_ener'>valor_ener</span>
827
+ <span class='kw'>end</span></pre>
828
+ </td>
829
+ </tr>
830
+ </table>
831
+ </div>
832
+
833
+ <div class="method_details ">
834
+ <h3 class="signature " id="==-instance_method">
835
+
836
+ #<strong>==</strong>(other) &#x21d2; <tt>Object</tt>
837
+
838
+
839
+
840
+
841
+
842
+ </h3><table class="source_code">
843
+ <tr>
844
+ <td>
845
+ <pre class="lines">
846
+
847
+
848
+ 23
849
+ 24
850
+ 25</pre>
851
+ </td>
852
+ <td>
853
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 23</span>
854
+
855
+ <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>
856
+ <span class='id identifier rubyid_alimento'>alimento</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_alimento'>alimento</span>
857
+ <span class='kw'>end</span></pre>
858
+ </td>
859
+ </tr>
860
+ </table>
861
+ </div>
862
+
863
+ <div class="method_details ">
864
+ <h3 class="signature " id="AIBC-instance_method">
865
+
866
+ #<strong>AIBC</strong> &#x21d2; <tt>Object</tt>
867
+
868
+
869
+
870
+
871
+
872
+ </h3><div class="docstring">
873
+ <div class="discussion">
874
+
875
+ <p>Método para calcular el Área incremental bajo la curva (AIBC) de un
876
+ alimento o glucosa, dependiendo de que se le pase por parametro</p>
877
+
878
+
879
+ </div>
880
+ </div>
881
+ <div class="tags">
882
+ <p class="tag_title">Parameters:</p>
883
+ <ul class="param">
884
+
885
+ <li>
886
+
887
+ <span class='name'>mediciones</span>
888
+
889
+
890
+ <span class='type'></span>
891
+
892
+
893
+
894
+ &mdash;
895
+ <div class='inline'>
896
+ <p>vector que contiene mediciones de glucosa o de un alimento</p>
897
+ </div>
898
+
899
+ </li>
900
+
901
+ </ul>
902
+
903
+
904
+ </div><table class="source_code">
905
+ <tr>
906
+ <td>
907
+ <pre class="lines">
908
+
909
+
910
+ 53
911
+ 54
912
+ 55
913
+ 56
914
+ 57
915
+ 58
916
+ 59
917
+ 60
918
+ 61
919
+ 62</pre>
920
+ </td>
921
+ <td>
922
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 53</span>
923
+
924
+ <span class='kw'>def</span> <span class='const'>AIBC</span>
925
+ <span class='id identifier rubyid_aibc'>aibc</span><span class='op'>=</span><span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
926
+ <span class='id identifier rubyid_g'>g</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span>
927
+ <span class='id identifier rubyid_almacen'>almacen</span><span class='op'>=</span><span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
928
+ <span class='id identifier rubyid_vec_2'>vec_2</span><span class='op'>=</span><span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_zip'>zip</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_drop'>drop</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span><span class='rparen'>)</span>
929
+ <span class='id identifier rubyid_vec_2'>vec_2</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_val'>val</span><span class='op'>|</span> <span class='id identifier rubyid_almacen'>almacen</span><span class='op'>&lt;&lt;</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='op'>+</span><span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='id identifier rubyid_val'>val</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='op'>-</span><span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='op'>/</span><span class='int'>2</span><span class='rparen'>)</span><span class='op'>*</span><span class='int'>5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span><span class='rbrace'>}</span>
930
+ <span class='id identifier rubyid_aibc'>aibc</span><span class='op'>&lt;&lt;</span><span class='lparen'>(</span><span class='id identifier rubyid_almacen'>almacen</span><span class='period'>.</span><span class='id identifier rubyid_reduce'>reduce</span> <span class='symbol'>:+</span><span class='rparen'>)</span>
931
+ <span class='kw'>end</span>
932
+ <span class='id identifier rubyid_aibc'>aibc</span>
933
+ <span class='kw'>end</span></pre>
934
+ </td>
935
+ </tr>
936
+ </table>
937
+ </div>
938
+
939
+ <div class="method_details ">
940
+ <h3 class="signature " id="to_s-instance_method">
941
+
942
+ #<strong>to_s</strong> &#x21d2; <tt>Object</tt>
943
+
944
+
945
+
946
+
947
+
948
+ </h3><div class="docstring">
949
+ <div class="discussion">
950
+
951
+ <p>Método para definir la forma en la que mostrar los datos del alimento</p>
952
+
953
+
954
+ </div>
955
+ </div>
956
+ <div class="tags">
957
+
958
+
959
+ </div><table class="source_code">
960
+ <tr>
961
+ <td>
962
+ <pre class="lines">
963
+
964
+
965
+ 41
966
+ 42
967
+ 43</pre>
968
+ </td>
969
+ <td>
970
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 41</span>
971
+
972
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
973
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='ivar'>@alimento</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='ivar'>@proteinas</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='ivar'>@glucidos</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='ivar'>@grasas</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>&quot;</span></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="valor_ener-instance_method">
982
+
983
+ #<strong>valor_ener</strong> &#x21d2; <tt>Object</tt>
984
+
985
+
986
+
987
+
988
+
989
+ </h3><div class="docstring">
990
+ <div class="discussion">
991
+
992
+ <p>Método para calcular el valor energetico del alimento</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
+ 46
1007
+ 47
1008
+ 48</pre>
1009
+ </td>
1010
+ <td>
1011
+ <pre class="code"><span class="info file"># File 'lib/prct06/alimentos.rb', line 46</span>
1012
+
1013
+ <span class='kw'>def</span> <span class='id identifier rubyid_valor_ener'>valor_ener</span>
1014
+ <span class='lparen'>(</span><span class='ivar'>@glucidos</span><span class='op'>*</span><span class='int'>4</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@grasas</span><span class='op'>*</span><span class='int'>9</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@proteinas</span><span class='op'>*</span><span class='int'>4</span><span class='rparen'>)</span>
1015
+ <span class='kw'>end</span></pre>
1016
+ </td>
1017
+ </tr>
1018
+ </table>
1019
+ </div>
1020
+
1021
+ </div>
1022
+
1023
+ </div>
1024
+
1025
+ <div id="footer">
1026
+ Generated on Tue Nov 28 12:07:27 2017 by
1027
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1028
+ 0.9.12 (ruby-2.4.2).
1029
+ </div>
1030
+
1031
+ </div>
1032
+ </body>
1033
+ </html>