alimento-alu0100912005 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +2 -0
  3. data/.gitignore +12 -0
  4. data/.travis.yml +8 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +12 -0
  7. data/Guardfile +82 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +81 -0
  10. data/Rakefile +6 -0
  11. data/alimento.gemspec +43 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/doc/Aibc.html +434 -0
  15. data/doc/Alimento.html +128 -0
  16. data/doc/Food.html +1063 -0
  17. data/doc/ListaDoblementeEnlazada.html +1308 -0
  18. data/doc/Node.html +409 -0
  19. data/doc/Piramide.html +407 -0
  20. data/doc/_index.html +164 -0
  21. data/doc/class_list.html +51 -0
  22. data/doc/css/common.css +1 -0
  23. data/doc/css/full_list.css +58 -0
  24. data/doc/css/style.css +499 -0
  25. data/doc/file.README.html +146 -0
  26. data/doc/file_list.html +56 -0
  27. data/doc/frames.html +17 -0
  28. data/doc/index.html +146 -0
  29. data/doc/js/app.js +248 -0
  30. data/doc/js/full_list.js +216 -0
  31. data/doc/js/jquery.js +4 -0
  32. data/doc/method_list.html +307 -0
  33. data/doc/top-level-namespace.html +112 -0
  34. data/docs/Aibc.html +434 -0
  35. data/docs/Alimento.html +128 -0
  36. data/docs/Food.html +1063 -0
  37. data/docs/ListaDoblementeEnlazada.html +1308 -0
  38. data/docs/Node.html +409 -0
  39. data/docs/Piramide.html +407 -0
  40. data/docs/_index.html +164 -0
  41. data/docs/class_list.html +51 -0
  42. data/docs/css/common.css +1 -0
  43. data/docs/css/full_list.css +58 -0
  44. data/docs/css/style.css +492 -0
  45. data/docs/file.README.html +146 -0
  46. data/docs/file_list.html +56 -0
  47. data/docs/frames.html +17 -0
  48. data/docs/index.html +146 -0
  49. data/docs/js/app.js +248 -0
  50. data/docs/js/full_list.js +216 -0
  51. data/docs/js/jquery.js +4 -0
  52. data/docs/method_list.html +307 -0
  53. data/docs/top-level-namespace.html +112 -0
  54. data/lib/alimento.rb +8 -0
  55. data/lib/alimento/alimento.rb +152 -0
  56. data/lib/alimento/lista.rb +176 -0
  57. data/lib/alimento/plato.rb +233 -0
  58. data/lib/alimento/version.rb +4 -0
  59. metadata +213 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7dfc8bb6580b9f80cc9720f0a4bd3af387f3e02c
4
+ data.tar.gz: 138af39c4d9ea9a3d62bbe6649421b3abb9e1e6f
5
+ SHA512:
6
+ metadata.gz: 2410ab5262c991c4a102e0914b1d5d2edc546969fd1cfd0582b3e58cb392f200d0c15c48a2dd76d8dae3c77917b4b988ecd46f826410a09b9e4637de44f439d2
7
+ data.tar.gz: 79d11f8e552f2d337eca93fa37b172838fd98fa661e0a155d71bdd9715c1a3a261dddfec585565a2bcec878513e4682ab7682dd81f6c1bf4662abaa3d905cc35
data/.coveralls.yml ADDED
@@ -0,0 +1,2 @@
1
+ service_name: travis-pro
2
+ repo_token: BQPUXAsfB9GEXpHhwMgPA46unkf8Y76au
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ #/doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.1.5
5
+ - 2.4.0
6
+ # - jruby
7
+ # - rbx-3
8
+ 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 nico10907@hotmail.com. 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,12 @@
1
+ gem 'coveralls', require: false
2
+ source "https://rubygems.org"
3
+
4
+ git_source(:github) {|repo_name| "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100912005" }
5
+
6
+ # Specify your gem's dependencies in alimento.gemspec
7
+ gemspec
8
+
9
+ group :development do
10
+ gem 'guard'
11
+ end
12
+
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 nico_apache
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,81 @@
1
+ [![Coverage Status](https://coveralls.io/repos/github/alu0100912005/nutrientes/badge.svg?branch=master)](https://coveralls.io/github/alu0100912005/nutrientes?branch=master)
2
+
3
+ [![Build Status](https://travis-ci.org/alu0100912005/nutrientes.svg?branch=master)](https://travis-ci.org/alu0100912005/nutrientes)
4
+
5
+ # Practica 11 - LPP 17/18 - Nicolangelo Famiglietti
6
+
7
+ ## Descripcion
8
+
9
+ Esta practica de laboratorio se ha de realizar utilizando el lenguaje de programacion `Ruby` y el paradigma de Programacion Funcional.
10
+ Se ha de partir de la estructura de la gema generada con la herramienta `Bundler` y realizar el control de versiones con `git` siguiendo su filosofia de ramas.
11
+ Para el desarrollo de las clases se ha de seguir la metodologia de *Desarrollo dirigido por pruebas*
12
+ (Test Driven Development - TDD) y la herramienta `RSpec`.
13
+ Considere la jerarquia de clases Ruby para representar alimentos y listas de practicas anteriores.
14
+
15
+ ## TODO
16
+
17
+ 1. Diseñar e implementar un Lenguaje de *Dominio Específico Domain Specific Language - DSL*, siguiendo la filosofía de `Ruby` que permita la definición de Platos Harvard.
18
+ Los DSL son herramientas útiles que permiten expresar fácilmente la lógica específica de un problema particular (dominio) que de otro modo sería difícil o farragoso de escribir en otro
19
+ idioma. Por lo general, se trata de definir una gramática que se asemeja más al léxico utilizado por el dominio de destino. Por ejemplo, un matemático que trabaja con matrices no piensa en
20
+ bucles, iteradores o arrays, sino que piensa en términos de vectores, productos y transformaciones. El uso de un lenguaje de propósito general, como Ruby, con sólo arrays e iteradores requeriría que el matemático practicara gimnasia mental para traducir mentalmente entre el dominio de su
21
+ problema y el del lenguaje con el que escribe el código (Ruby). El uso de un DSL diseñado para las operaciones que le interesan eliminaría esta traducción mental y proporcionaría un código
22
+ más conciso.
23
+ Los DSL tienen dos formas: externos e internos. Los DSL externos existen independientemente de cualquier otro lenguaje. Los DSL internos estan alojados dentro de otro lenguaje de programación - por ejemplo, Rails es un DSL interno que se aloja en el lenguaje de programación Ruby.
24
+ El DSL que diseñe ha de permitir la definición de platos de una forma natural.
25
+
26
+ 2. La salida del ejemplo anterior podría ser como la siguiente:
27
+
28
+
29
+ Lentejas con arroz, salsa de tomate, huevo y plátano a la plancha
30
+
31
+ =================================================================
32
+
33
+ Composición nutricional:
34
+
35
+ glúcidos proteínas lípidos valor energético
36
+
37
+ Tomate 1.0 3.5 0.2 56.4
38
+
39
+ Plátano 1.2 21.4 0.2 182.4
40
+
41
+ Arroz 6.8 77.7 0.6 1021.2
42
+
43
+ Lentejas 23.5 52.0 1.4 1538.0
44
+
45
+ Huevo 3.3 4.8 3.2 72.32
46
+
47
+ Aceite de oliva 0.0 0.2 99.6 39.92
48
+
49
+ Valor energético total 2910.24
50
+
51
+ 3. Crear una cuenta en rubygems.org. El `‘handle’` que se solicita es el nombre de usuario.
52
+ 4. Almacenar las credenciales de rubygems.org en la máquina local.
53
+
54
+ `curl -u qrush https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials`
55
+
56
+ 5. Puesto que ya se terminado de escribir código, se está listos para construir y publicar la gema.
57
+ -Para construir la gema, desde el directorio raíz creado con `Bundler` ejecutar: `rake build`
58
+ -Para crear la `version 0.1.0` de la gema ejecutar: `rake release`
59
+ -Para instalar gema ejecutar: `rake install`
60
+ -Para comprobrar que ha ido bien la instalación , ejecutar: `gem menu`
61
+
62
+ 6. Escribir la dirección http de la gema que ha creado en la tarea del campus virtual.
63
+
64
+
65
+ ## Usage
66
+ https://ull-esit-lpp-1718.github.io/tdd-alu0100912005/
67
+
68
+ Fork clase `Point`:
69
+
70
+ https://github.com/alu0100912005/point
71
+ ### Gemas utilizadas:
72
+
73
+ <li>bundler</li>
74
+ <li>rake</li>
75
+ <li>rspec</li>
76
+ <li>guard</li>
77
+ <li>yard</li>
78
+ <li>travis</li>
79
+ <li>coveralls</li>
80
+
81
+ ### En P11
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/alimento.gemspec ADDED
@@ -0,0 +1,43 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "alimento/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "alimento-alu0100912005"
8
+ spec.version = Alimento::VERSION
9
+ spec.authors = ["Nicolangelo Famiglietti"]
10
+ spec.email = ["alu0100912005@ull.edu.es"]
11
+
12
+ spec.summary = %q{Practica 6 LPP 17/18.}
13
+ spec.description = %q{Practica 6 TDD LPP 17/18}
14
+ spec.homepage = "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100912005"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # # spec.metadata["allowed_push_host"] = "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100912005"
21
+ # spec.metadata['allowed_push_host'] = "https://rubygems.org"
22
+ # else
23
+ # raise "RubyGems 2.0 or newer is required to protect against " \
24
+ # "public gem pushes."
25
+ # end
26
+
27
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
28
+ f.match(%r{^(test|spec|features)/})
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ spec.add_development_dependency "bundler", "~> 1.15"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "rspec", "~> 3.0"
37
+ spec.add_development_dependency "guard"
38
+ spec.add_development_dependency "guard-rspec"
39
+ spec.add_development_dependency "guard-bundler"
40
+ spec.add_development_dependency "yard"
41
+ spec.add_development_dependency "coveralls"
42
+
43
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "alimento"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -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
data/doc/Aibc.html ADDED
@@ -0,0 +1,434 @@
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: Aibc
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 = "Aibc";
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">Aibc</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: Aibc
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></li>
78
+
79
+ <li class="next">Aibc</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/alimento/alimento.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <div class="note notetag">
108
+ <strong>Note:</strong>
109
+ <div class='inline'>
110
+ <p>Clase Aibc heredada de Food para el calculo del aibc del alimento</p>
111
+ </div>
112
+ </div>
113
+
114
+
115
+
116
+ </div>
117
+ </div>
118
+ <div class="tags">
119
+
120
+
121
+ </div>
122
+
123
+
124
+
125
+
126
+
127
+ <h2>Instance Attribute Summary</h2>
128
+
129
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></h3>
130
+ <p class="inherited"><span class='object_link'><a href="Food.html#glucidos-instance_method" title="Food#glucidos (method)">#glucidos</a></span>, <span class='object_link'><a href="Food.html#glucosa-instance_method" title="Food#glucosa (method)">#glucosa</a></span>, <span class='object_link'><a href="Food.html#grasas-instance_method" title="Food#grasas (method)">#grasas</a></span>, <span class='object_link'><a href="Food.html#n_grupo-instance_method" title="Food#n_grupo (method)">#n_grupo</a></span>, <span class='object_link'><a href="Food.html#nombre-instance_method" title="Food#nombre (method)">#nombre</a></span>, <span class='object_link'><a href="Food.html#proteinas-instance_method" title="Food#proteinas (method)">#proteinas</a></span>, <span class='object_link'><a href="Food.html#valores-instance_method" title="Food#valores (method)">#valores</a></span></p>
131
+
132
+
133
+
134
+ <h2>
135
+ Instance Method Summary
136
+ <small><a href="#" class="summary_toggle">collapse</a></small>
137
+ </h2>
138
+
139
+ <ul class="summary">
140
+
141
+ <li class="public ">
142
+ <span class="summary_signature">
143
+
144
+ <a href="#aibc-instance_method" title="#aibc (instance method)">#<strong>aibc</strong> &#x21d2; Object </a>
145
+
146
+
147
+
148
+ </span>
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+ <span class="summary_desc"><div class='inline'>
159
+ <h2 id="label-Returns-3A+Valor+del+indice+gluc-C3-A9mico.">Returns: Valor del indice glucémico.</h2>
160
+ </div></span>
161
+
162
+ </li>
163
+
164
+
165
+ <li class="public ">
166
+ <span class="summary_signature">
167
+
168
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(nombre, proteinas, glucidos, grasas, valores, glucosa) &#x21d2; Aibc </a>
169
+
170
+
171
+
172
+ </span>
173
+
174
+
175
+ <span class="note title constructor">constructor</span>
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+ <span class="summary_desc"><div class='inline'>
185
+ <h2 id="label-Returns-3A+Inicializa+nombre-2C+proteinas-2C+glucidos-2C+grasas+y+valores.">Returns: Inicializa nombre, proteinas, glucidos, grasas y valores.</h2>
186
+ </div></span>
187
+
188
+ </li>
189
+
190
+
191
+ </ul>
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></h3>
204
+ <p class="inherited"><span class='object_link'><a href="Food.html#<=>-instance_method" title="Food#&lt;=&gt; (method)">#<=></a></span>, <span class='object_link'><a href="Food.html#get_ve-instance_method" title="Food#get_ve (method)">#get_ve</a></span>, <span class='object_link'><a href="Food.html#to_s-instance_method" title="Food#to_s (method)">#to_s</a></span></p>
205
+
206
+ <div id="constructor_details" class="method_details_list">
207
+ <h2>Constructor Details</h2>
208
+
209
+ <div class="method_details first">
210
+ <h3 class="signature first" id="initialize-instance_method">
211
+
212
+ #<strong>initialize</strong>(nombre, proteinas, glucidos, grasas, valores, glucosa) &#x21d2; <tt><span class='object_link'><a href="" title="Aibc (class)">Aibc</a></span></tt>
213
+
214
+
215
+
216
+
217
+
218
+ </h3><div class="docstring">
219
+ <div class="discussion">
220
+
221
+ <div class="note notetag">
222
+ <strong>Note:</strong>
223
+ <div class='inline'>
224
+ <p>Inicializador de la clase heredada</p>
225
+ </div>
226
+ </div>
227
+
228
+
229
+ <h2 id="label-Returns-3A">Returns:</h2>
230
+
231
+ <p>Inicializa nombre, proteinas, glucidos, grasas y valores</p>
232
+
233
+
234
+ </div>
235
+ </div>
236
+ <div class="tags">
237
+
238
+
239
+ </div><table class="source_code">
240
+ <tr>
241
+ <td>
242
+ <pre class="lines">
243
+
244
+
245
+ 91
246
+ 92
247
+ 93
248
+ 94
249
+ 95</pre>
250
+ </td>
251
+ <td>
252
+ <pre class="code"><span class="info file"># File 'lib/alimento/alimento.rb', line 91</span>
253
+
254
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_nombre'>nombre</span><span class='comma'>,</span> <span class='id identifier rubyid_proteinas'>proteinas</span><span class='comma'>,</span> <span class='id identifier rubyid_glucidos'>glucidos</span><span class='comma'>,</span> <span class='id identifier rubyid_grasas'>grasas</span><span class='comma'>,</span> <span class='id identifier rubyid_valores'>valores</span><span class='comma'>,</span> <span class='id identifier rubyid_glucosa'>glucosa</span><span class='rparen'>)</span>
255
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_nombre'>nombre</span><span class='comma'>,</span> <span class='id identifier rubyid_proteinas'>proteinas</span><span class='comma'>,</span> <span class='id identifier rubyid_glucidos'>glucidos</span><span class='comma'>,</span> <span class='id identifier rubyid_grasas'>grasas</span><span class='rparen'>)</span>
256
+ <span class='ivar'>@g</span> <span class='op'>=</span> <span class='id identifier rubyid_valores'>valores</span>
257
+ <span class='ivar'>@glu</span> <span class='op'>=</span> <span class='id identifier rubyid_glucosa'>glucosa</span>
258
+ <span class='kw'>end</span></pre>
259
+ </td>
260
+ </tr>
261
+ </table>
262
+ </div>
263
+
264
+ </div>
265
+
266
+
267
+ <div id="instance_method_details" class="method_details_list">
268
+ <h2>Instance Method Details</h2>
269
+
270
+
271
+ <div class="method_details first">
272
+ <h3 class="signature first" id="aibc-instance_method">
273
+
274
+ #<strong>aibc</strong> &#x21d2; <tt>Object</tt>
275
+
276
+
277
+
278
+
279
+
280
+ </h3><div class="docstring">
281
+ <div class="discussion">
282
+
283
+ <div class="note notetag">
284
+ <strong>Note:</strong>
285
+ <div class='inline'>
286
+ <p>Metodo AIBC para el calculo del indice glucémico</p>
287
+ </div>
288
+ </div>
289
+
290
+
291
+ <h2 id="label-Returns-3A">Returns:</h2>
292
+
293
+ <p>Valor del indice glucémico</p>
294
+
295
+
296
+ </div>
297
+ </div>
298
+ <div class="tags">
299
+
300
+
301
+ </div><table class="source_code">
302
+ <tr>
303
+ <td>
304
+ <pre class="lines">
305
+
306
+
307
+ 99
308
+ 100
309
+ 101
310
+ 102
311
+ 103
312
+ 104
313
+ 105
314
+ 106
315
+ 107
316
+ 108
317
+ 109
318
+ 110
319
+ 111
320
+ 112
321
+ 113
322
+ 114
323
+ 115
324
+ 116
325
+ 117
326
+ 118
327
+ 119
328
+ 120
329
+ 121
330
+ 122
331
+ 123
332
+ 124
333
+ 125
334
+ 126
335
+ 127
336
+ 128
337
+ 129
338
+ 130
339
+ 131
340
+ 132
341
+ 133
342
+ 134
343
+ 135
344
+ 136
345
+ 137
346
+ 138
347
+ 139
348
+ 140
349
+ 141
350
+ 142
351
+ 143
352
+ 144
353
+ 145
354
+ 146
355
+ 147
356
+ 148
357
+ 149
358
+ 150
359
+ 151</pre>
360
+ </td>
361
+ <td>
362
+ <pre class="code"><span class="info file"># File 'lib/alimento/alimento.rb', line 99</span>
363
+
364
+ <span class='kw'>def</span> <span class='id identifier rubyid_aibc'>aibc</span>
365
+ <span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
366
+ <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span>
367
+ <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
368
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
369
+ <span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>24</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span>
370
+ <span class='op'>|</span><span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
371
+ <span class='kw'>if</span> <span class='ivar'>@g</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span> <span class='op'>&lt;</span> <span class='ivar'>@g</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
372
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='float'>0.0</span>
373
+ <span class='kw'>else</span>
374
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@g</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='ivar'>@g</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@g</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='ivar'>@g</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</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>
375
+ <span class='kw'>end</span>
376
+ <span class='rbrace'>}</span>
377
+ <span class='id identifier rubyid_r'>r</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_s'>s</span>
378
+ <span class='rbrace'>}</span>
379
+
380
+ <span class='id identifier rubyid_aibc_alimento'>aibc_alimento</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
381
+ <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_j'>j</span><span class='op'>|</span>
382
+ <span class='id identifier rubyid_s'>s</span><span class='op'>=</span><span class='int'>0</span>
383
+ <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>23</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span>
384
+ <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span>
385
+ <span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='id identifier rubyid_s'>s</span> <span class='op'>+</span> <span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_j'>j</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span>
386
+ <span class='rbrace'>}</span>
387
+ <span class='id identifier rubyid_aibc_alimento'>aibc_alimento</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_s'>s</span>
388
+ <span class='rbrace'>}</span>
389
+
390
+ <span class='id identifier rubyid_r1'>r1</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
391
+ <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span>
392
+ <span class='op'>|</span><span class='id identifier rubyid_i1'>i1</span><span class='op'>|</span>
393
+ <span class='id identifier rubyid_s1'>s1</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
394
+ <span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>24</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span>
395
+ <span class='op'>|</span><span class='id identifier rubyid_index1'>index1</span><span class='op'>|</span>
396
+ <span class='kw'>if</span> <span class='ivar'>@glu</span><span class='lbracket'>[</span><span class='id identifier rubyid_i1'>i1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_index1'>index1</span><span class='rbracket'>]</span> <span class='op'>&lt;</span> <span class='ivar'>@glu</span><span class='lbracket'>[</span><span class='id identifier rubyid_i1'>i1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
397
+ <span class='id identifier rubyid_s1'>s1</span> <span class='op'>&lt;&lt;</span> <span class='float'>0.0</span>
398
+ <span class='kw'>else</span>
399
+ <span class='id identifier rubyid_s1'>s1</span> <span class='op'>&lt;&lt;</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@glu</span><span class='lbracket'>[</span><span class='id identifier rubyid_i1'>i1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_index1'>index1</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='ivar'>@glu</span><span class='lbracket'>[</span><span class='id identifier rubyid_i1'>i1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@glu</span><span class='lbracket'>[</span><span class='id identifier rubyid_i1'>i1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_index1'>index1</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='ivar'>@glu</span><span class='lbracket'>[</span><span class='id identifier rubyid_i1'>i1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</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>
400
+ <span class='kw'>end</span>
401
+ <span class='rbrace'>}</span>
402
+ <span class='id identifier rubyid_r1'>r1</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_s1'>s1</span>
403
+ <span class='rbrace'>}</span>
404
+ <span class='id identifier rubyid_aibc_glucosa'>aibc_glucosa</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
405
+ <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span>
406
+ <span class='op'>|</span><span class='id identifier rubyid_j1'>j1</span><span class='op'>|</span>
407
+ <span class='id identifier rubyid_s1'>s1</span><span class='op'>=</span><span class='int'>0</span>
408
+ <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>23</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span>
409
+ <span class='op'>|</span><span class='id identifier rubyid_k1'>k1</span><span class='op'>|</span>
410
+ <span class='id identifier rubyid_s1'>s1</span> <span class='op'>=</span> <span class='id identifier rubyid_s1'>s1</span> <span class='op'>+</span> <span class='id identifier rubyid_r1'>r1</span><span class='lbracket'>[</span><span class='id identifier rubyid_j1'>j1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_k1'>k1</span><span class='rbracket'>]</span>
411
+ <span class='rbrace'>}</span>
412
+ <span class='id identifier rubyid_aibc_glucosa'>aibc_glucosa</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_s1'>s1</span>
413
+ <span class='rbrace'>}</span>
414
+
415
+ <span class='id identifier rubyid_ig_alimento'>ig_alimento</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_aibc_alimento'>aibc_alimento</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>/</span><span class='id identifier rubyid_aibc_glucosa'>aibc_glucosa</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'>100</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_aibc_alimento'>aibc_alimento</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>/</span><span class='id identifier rubyid_aibc_glucosa'>aibc_glucosa</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='op'>*</span><span class='int'>100</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='op'>/</span><span class='int'>2</span>
416
+ <span class='kw'>end</span></pre>
417
+ </td>
418
+ </tr>
419
+ </table>
420
+ </div>
421
+
422
+ </div>
423
+
424
+ </div>
425
+
426
+ <div id="footer">
427
+ Generated on Tue Nov 28 21:08:09 2017 by
428
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
429
+ 0.9.12 (ruby-2.3.0).
430
+ </div>
431
+
432
+ </div>
433
+ </body>
434
+ </html>