Dieta 0.2.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.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.travis.yml +5 -0
  4. data/Dieta.gemspec +36 -0
  5. data/Gemfile +4 -0
  6. data/Guardfile +82 -0
  7. data/README.md +49 -0
  8. data/Rakefile +6 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/doc/Dieta.html +111 -0
  12. data/doc/Dieta/Dieta.html +648 -0
  13. data/doc/Lista.html +313 -0
  14. data/doc/ListaDoblementeEnlazada.html +472 -0
  15. data/doc/MenuPorClaseDeAlimento.html +267 -0
  16. data/doc/MenuPorGrupoDeEdad.html +267 -0
  17. data/doc/Object.html +121 -0
  18. data/doc/created.rid +5 -0
  19. data/doc/css/fonts.css +167 -0
  20. data/doc/css/rdoc.css +590 -0
  21. data/doc/fonts/Lato-Light.ttf +0 -0
  22. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  23. data/doc/fonts/Lato-Regular.ttf +0 -0
  24. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  25. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  26. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  27. data/doc/images/add.png +0 -0
  28. data/doc/images/arrow_up.png +0 -0
  29. data/doc/images/brick.png +0 -0
  30. data/doc/images/brick_link.png +0 -0
  31. data/doc/images/bug.png +0 -0
  32. data/doc/images/bullet_black.png +0 -0
  33. data/doc/images/bullet_toggle_minus.png +0 -0
  34. data/doc/images/bullet_toggle_plus.png +0 -0
  35. data/doc/images/date.png +0 -0
  36. data/doc/images/delete.png +0 -0
  37. data/doc/images/find.png +0 -0
  38. data/doc/images/loadingAnimation.gif +0 -0
  39. data/doc/images/macFFBgHack.png +0 -0
  40. data/doc/images/package.png +0 -0
  41. data/doc/images/page_green.png +0 -0
  42. data/doc/images/page_white_text.png +0 -0
  43. data/doc/images/page_white_width.png +0 -0
  44. data/doc/images/plugin.png +0 -0
  45. data/doc/images/ruby.png +0 -0
  46. data/doc/images/tag_blue.png +0 -0
  47. data/doc/images/tag_green.png +0 -0
  48. data/doc/images/transparent.png +0 -0
  49. data/doc/images/wrench.png +0 -0
  50. data/doc/images/wrench_orange.png +0 -0
  51. data/doc/images/zoom.png +0 -0
  52. data/doc/index.html +92 -0
  53. data/doc/js/darkfish.js +161 -0
  54. data/doc/js/jquery.js +4 -0
  55. data/doc/js/navigation.js +142 -0
  56. data/doc/js/navigation.js.gz +0 -0
  57. data/doc/js/search.js +109 -0
  58. data/doc/js/search_index.js +1 -0
  59. data/doc/js/search_index.js.gz +0 -0
  60. data/doc/js/searcher.js +228 -0
  61. data/doc/js/searcher.js.gz +0 -0
  62. data/doc/table_of_contents.html +212 -0
  63. data/lib/Dieta.rb +7 -0
  64. data/lib/Dieta/dieta_codigo.rb +149 -0
  65. data/lib/Dieta/lista_codigo.rb +151 -0
  66. data/lib/Dieta/version.rb +3 -0
  67. metadata +193 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dbe10eb82081c0abf3a2d33d69d6e87d71267386
4
+ data.tar.gz: 18cc46b3f88e7e4bea2191b15b0f6e58c510b35b
5
+ SHA512:
6
+ metadata.gz: bca08a21c877613290898a3d949ad043db2ca9c9a3807ce3510cb33e707585a623018189649a295ae1e5b6f16dab49efab58f210989b2c5b7a0279965a3a0261
7
+ data.tar.gz: 0e51e6b167529d0eecee324ee39484b81c25828eca107fe07b5a70a50777153c8b16d2bb5b01df94e4e5070b84eac34d21ce77f0a435c3e828fd5e79cd2f877c
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.0
5
+ before_install: gem install bundler -v 1.12.5
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'Dieta/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "Dieta"
8
+ spec.version = Dieta::VERSION
9
+ spec.authors = ["alu0100890839"]
10
+ spec.email = ["alu0100890839@ull.edu.es"]
11
+
12
+ spec.summary = %q{Practica 7 de LPP}
13
+ spec.description = "Practica 8, en la que a los menús de la 6 y 7 les añadimos la clase lista doblemente enlazada y nos aproximamos a la jerarquia de clases (Herencia)"
14
+ spec.homepage = "https://github.com/ULL-ESIT-LPP-1617/menu-dietetico-alu0100890839"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ #if spec.respond_to?(:metadata)
19
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ #else
21
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ #end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.12"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rspec", "~> 3.0"
32
+ spec.add_development_dependency "guard"
33
+ spec.add_development_dependency "guard-rspec"
34
+ spec.add_development_dependency "guard-bundler"
35
+
36
+ end
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in Dieta.gemspec
4
+ gemspec
@@ -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
@@ -0,0 +1,49 @@
1
+ # Practica 11 de LPPP
2
+
3
+ ## DSL y Menu semanal
4
+
5
+ * Pablo Pastor Martín
6
+
7
+ # Dieta
8
+
9
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/Dieta`. To experiment with that code, run `bin/console` for an interactive prompt.
10
+
11
+ TODO: Delete this and the text above, and describe your gem
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'Dieta'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install Dieta
28
+
29
+ ## Usage
30
+
31
+ Para inicializar una dieta (menu):
32
+ ```
33
+ Dieta::Dieta.new(["NOMBRE", %deingesta)],[["Ingrediente1","racion",peso],["Ingrediente2","racion",peso)]][kcal, %proteinas, %grasas, %hidratos]
34
+ ```
35
+
36
+ Para inicializar una lista:
37
+ `Lista.new`
38
+
39
+
40
+ ## Development
41
+
42
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
43
+
44
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
45
+
46
+ ## Contributing
47
+
48
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Dieta.
49
+
@@ -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
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "Dieta"
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
@@ -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,111 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>module Dieta - RDoc Documentation</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ </script>
12
+
13
+ <script src="./js/jquery.js"></script>
14
+ <script src="./js/darkfish.js"></script>
15
+
16
+ <link href="./css/fonts.css" rel="stylesheet">
17
+ <link href="./css/rdoc.css" rel="stylesheet">
18
+
19
+
20
+
21
+ <body id="top" role="document" class="module">
22
+ <nav role="navigation">
23
+ <div id="project-navigation">
24
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
+ <h2>
26
+ <a href="./index.html" rel="home">Home</a>
27
+ </h2>
28
+
29
+ <div id="table-of-contents-navigation">
30
+ <a href="./table_of_contents.html#pages">Pages</a>
31
+ <a href="./table_of_contents.html#classes">Classes</a>
32
+ <a href="./table_of_contents.html#methods">Methods</a>
33
+ </div>
34
+ </div>
35
+
36
+ <div id="search-section" role="search" class="project-section initially-hidden">
37
+ <form action="#" method="get" accept-charset="utf-8">
38
+ <div id="search-field-wrapper">
39
+ <input id="search-field" role="combobox" aria-label="Search"
40
+ aria-autocomplete="list" aria-controls="search-results"
41
+ type="text" name="search" placeholder="Search" spellcheck="false"
42
+ title="Type to search, Up and Down to navigate, Enter to load">
43
+ </div>
44
+
45
+ <ul id="search-results" aria-label="Search Results"
46
+ aria-busy="false" aria-expanded="false"
47
+ aria-atomic="false" class="initially-hidden"></ul>
48
+ </form>
49
+ </div>
50
+
51
+ </div>
52
+
53
+
54
+
55
+ <div id="class-metadata">
56
+
57
+
58
+
59
+
60
+
61
+ </div>
62
+ </nav>
63
+
64
+ <main role="main" aria-labelledby="module-Dieta">
65
+ <h1 id="module-Dieta" class="module">
66
+ module Dieta
67
+ </h1>
68
+
69
+ <section class="description">
70
+
71
+ <p>Modulo que contiene la dieta</p>
72
+
73
+ </section>
74
+
75
+
76
+
77
+
78
+ <section id="5Buntitled-5D" class="documentation-section">
79
+
80
+
81
+
82
+
83
+
84
+ <section class="constants-list">
85
+ <header>
86
+ <h3>Constants</h3>
87
+ </header>
88
+ <dl>
89
+
90
+ <dt id="VERSION">VERSION
91
+
92
+ <dd>
93
+
94
+
95
+ </dl>
96
+ </section>
97
+
98
+
99
+
100
+
101
+
102
+ </section>
103
+ </main>
104
+
105
+
106
+ <footer id="validator-badges" role="contentinfo">
107
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
108
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.2.
109
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
110
+ </footer>
111
+
@@ -0,0 +1,648 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Dieta::Dieta - RDoc Documentation</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "../";
11
+ </script>
12
+
13
+ <script src="../js/jquery.js"></script>
14
+ <script src="../js/darkfish.js"></script>
15
+
16
+ <link href="../css/fonts.css" rel="stylesheet">
17
+ <link href="../css/rdoc.css" rel="stylesheet">
18
+
19
+
20
+
21
+ <body id="top" role="document" class="class">
22
+ <nav role="navigation">
23
+ <div id="project-navigation">
24
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
+ <h2>
26
+ <a href="../index.html" rel="home">Home</a>
27
+ </h2>
28
+
29
+ <div id="table-of-contents-navigation">
30
+ <a href="../table_of_contents.html#pages">Pages</a>
31
+ <a href="../table_of_contents.html#classes">Classes</a>
32
+ <a href="../table_of_contents.html#methods">Methods</a>
33
+ </div>
34
+ </div>
35
+
36
+ <div id="search-section" role="search" class="project-section initially-hidden">
37
+ <form action="#" method="get" accept-charset="utf-8">
38
+ <div id="search-field-wrapper">
39
+ <input id="search-field" role="combobox" aria-label="Search"
40
+ aria-autocomplete="list" aria-controls="search-results"
41
+ type="text" name="search" placeholder="Search" spellcheck="false"
42
+ title="Type to search, Up and Down to navigate, Enter to load">
43
+ </div>
44
+
45
+ <ul id="search-results" aria-label="Search Results"
46
+ aria-busy="false" aria-expanded="false"
47
+ aria-atomic="false" class="initially-hidden"></ul>
48
+ </form>
49
+ </div>
50
+
51
+ </div>
52
+
53
+
54
+
55
+ <div id="class-metadata">
56
+
57
+ <div id="parent-class-section" class="nav-section">
58
+ <h3>Parent</h3>
59
+
60
+
61
+ <p class="link"><a href="../Object.html">Object</a>
62
+
63
+ </div>
64
+
65
+ <div id="includes-section" class="nav-section">
66
+ <h3>Included Modules</h3>
67
+
68
+ <ul class="link-list">
69
+
70
+
71
+ <li><span class="include">Comparable</span>
72
+
73
+
74
+ </ul>
75
+ </div>
76
+
77
+
78
+ <!-- Method Quickref -->
79
+ <div id="method-list-section" class="nav-section">
80
+ <h3>Methods</h3>
81
+
82
+ <ul class="link-list" role="directory">
83
+
84
+ <li ><a href="#method-c-new">::new</a>
85
+
86
+ <li ><a href="#method-i-3C-3D-3E">#&lt;=&gt;</a>
87
+
88
+ <li ><a href="#method-i-3D-3D">#==</a>
89
+
90
+ <li ><a href="#method-i-get_desc">#get_desc</a>
91
+
92
+ <li ><a href="#method-i-get_desc_plato">#get_desc_plato</a>
93
+
94
+ <li ><a href="#method-i-get_grasas">#get_grasas</a>
95
+
96
+ <li ><a href="#method-i-get_hidratos">#get_hidratos</a>
97
+
98
+ <li ><a href="#method-i-get_ingredientes">#get_ingredientes</a>
99
+
100
+ <li ><a href="#method-i-get_plato">#get_plato</a>
101
+
102
+ <li ><a href="#method-i-get_porcentaje_diario">#get_porcentaje_diario</a>
103
+
104
+ <li ><a href="#method-i-get_proteinas">#get_proteinas</a>
105
+
106
+ <li ><a href="#method-i-get_vct">#get_vct</a>
107
+
108
+ <li ><a href="#method-i-to_s">#to_s</a>
109
+
110
+ </ul>
111
+ </div>
112
+
113
+ </div>
114
+ </nav>
115
+
116
+ <main role="main" aria-labelledby="class-Dieta::Dieta">
117
+ <h1 id="class-Dieta::Dieta" class="class">
118
+ class Dieta::Dieta
119
+ </h1>
120
+
121
+ <section class="description">
122
+
123
+ <p>Clase para representar menús dietéticos</p>
124
+
125
+ </section>
126
+
127
+
128
+
129
+
130
+ <section id="5Buntitled-5D" class="documentation-section">
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ <section class="attribute-method-details" class="method-section">
139
+ <header>
140
+ <h3>Attributes</h3>
141
+ </header>
142
+
143
+
144
+ <div id="attribute-i-descripcion" class="method-detail">
145
+ <div class="method-heading attribute-method-heading">
146
+ <span class="method-name">descripcion</span><span
147
+ class="attribute-access-type">[R]</span>
148
+ </div>
149
+
150
+ <div class="method-description">
151
+
152
+
153
+
154
+ </div>
155
+ </div>
156
+
157
+ <div id="attribute-i-informacion" class="method-detail">
158
+ <div class="method-heading attribute-method-heading">
159
+ <span class="method-name">informacion</span><span
160
+ class="attribute-access-type">[R]</span>
161
+ </div>
162
+
163
+ <div class="method-description">
164
+
165
+
166
+
167
+ </div>
168
+ </div>
169
+
170
+ <div id="attribute-i-ingredientes" class="method-detail">
171
+ <div class="method-heading attribute-method-heading">
172
+ <span class="method-name">ingredientes</span><span
173
+ class="attribute-access-type">[R]</span>
174
+ </div>
175
+
176
+ <div class="method-description">
177
+
178
+
179
+
180
+ </div>
181
+ </div>
182
+
183
+ </section>
184
+
185
+
186
+
187
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
188
+ <header>
189
+ <h3>Public Class Methods</h3>
190
+ </header>
191
+
192
+
193
+ <div id="method-c-new" class="method-detail ">
194
+
195
+ <div class="method-heading">
196
+ <span class="method-name">new</span><span
197
+ class="method-args">(descripcion, ingredientes, informacion)</span>
198
+
199
+ <span class="method-click-advice">click to toggle source</span>
200
+
201
+ </div>
202
+
203
+
204
+ <div class="method-description">
205
+
206
+ <p>Metodo encargado de inicializar la clase</p>
207
+
208
+
209
+
210
+
211
+ <div class="method-source-code" id="new-source">
212
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 12</span>
213
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">descripcion</span>, <span class="ruby-identifier">ingredientes</span>, <span class="ruby-identifier">informacion</span>)
214
+ <span class="ruby-ivar">@descripcion</span>=<span class="ruby-identifier">descripcion</span>
215
+ <span class="ruby-ivar">@ingredientes</span>=<span class="ruby-identifier">ingredientes</span>
216
+ <span class="ruby-ivar">@informacion</span>=<span class="ruby-identifier">informacion</span>
217
+ <span class="ruby-keyword">end</span></pre>
218
+ </div>
219
+
220
+ </div>
221
+
222
+
223
+
224
+
225
+ </div>
226
+
227
+
228
+ </section>
229
+
230
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
231
+ <header>
232
+ <h3>Public Instance Methods</h3>
233
+ </header>
234
+
235
+
236
+ <div id="method-i-3C-3D-3E" class="method-detail ">
237
+
238
+ <div class="method-heading">
239
+ <span class="method-name">&lt;=&gt;</span><span
240
+ class="method-args">(anOther)</span>
241
+
242
+ <span class="method-click-advice">click to toggle source</span>
243
+
244
+ </div>
245
+
246
+
247
+ <div class="method-description">
248
+
249
+ <p>Metodo usado para comparar</p>
250
+
251
+
252
+
253
+
254
+ <div class="method-source-code" id="3C-3D-3E-source">
255
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 79</span>
256
+ <span class="ruby-keyword">def</span> <span class="ruby-operator">&lt;=&gt;</span>(<span class="ruby-identifier">anOther</span>)
257
+ <span class="ruby-ivar">@informacion</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">&lt;=&gt;</span><span class="ruby-identifier">anOther</span>.<span class="ruby-identifier">get_vct</span>
258
+ <span class="ruby-keyword">end</span></pre>
259
+ </div>
260
+
261
+ </div>
262
+
263
+
264
+
265
+
266
+ </div>
267
+
268
+
269
+ <div id="method-i-3D-3D" class="method-detail ">
270
+
271
+ <div class="method-heading">
272
+ <span class="method-name">==</span><span
273
+ class="method-args">(other)</span>
274
+
275
+ <span class="method-click-advice">click to toggle source</span>
276
+
277
+ </div>
278
+
279
+
280
+ <div class="method-description">
281
+
282
+ <p>Compara dos menus</p>
283
+
284
+
285
+
286
+
287
+ <div class="method-source-code" id="3D-3D-source">
288
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 74</span>
289
+ <span class="ruby-keyword">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
290
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_s</span>
291
+ <span class="ruby-keyword">end</span></pre>
292
+ </div>
293
+
294
+ </div>
295
+
296
+
297
+
298
+
299
+ </div>
300
+
301
+
302
+ <div id="method-i-get_desc" class="method-detail ">
303
+
304
+ <div class="method-heading">
305
+ <span class="method-name">get_desc</span><span
306
+ class="method-args">()</span>
307
+
308
+ <span class="method-click-advice">click to toggle source</span>
309
+
310
+ </div>
311
+
312
+
313
+ <div class="method-description">
314
+
315
+ <p>Metodo que devuelve el tipo de menu que es</p>
316
+
317
+
318
+
319
+
320
+ <div class="method-source-code" id="get_desc-source">
321
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 29</span>
322
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_desc</span>
323
+ <span class="ruby-ivar">@descripcion</span>[<span class="ruby-value">0</span>]
324
+ <span class="ruby-keyword">end</span></pre>
325
+ </div>
326
+
327
+ </div>
328
+
329
+
330
+
331
+
332
+ </div>
333
+
334
+
335
+ <div id="method-i-get_desc_plato" class="method-detail ">
336
+
337
+ <div class="method-heading">
338
+ <span class="method-name">get_desc_plato</span><span
339
+ class="method-args">(i)</span>
340
+
341
+ <span class="method-click-advice">click to toggle source</span>
342
+
343
+ </div>
344
+
345
+
346
+ <div class="method-description">
347
+
348
+ <p>Devuelve el ingrediente i-esimo formateado</p>
349
+
350
+
351
+
352
+
353
+ <div class="method-source-code" id="get_desc_plato-source">
354
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 69</span>
355
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_desc_plato</span>(<span class="ruby-identifier">i</span>)
356
+ <span class="ruby-ivar">@ingredientes</span>[<span class="ruby-identifier">i</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-string">&quot;: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot; #{@ingredientes[i][1]}, &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot; #{@ingredientes[i][2]} gramos&quot;</span>
357
+ <span class="ruby-keyword">end</span></pre>
358
+ </div>
359
+
360
+ </div>
361
+
362
+
363
+
364
+
365
+ </div>
366
+
367
+
368
+ <div id="method-i-get_grasas" class="method-detail ">
369
+
370
+ <div class="method-heading">
371
+ <span class="method-name">get_grasas</span><span
372
+ class="method-args">()</span>
373
+
374
+ <span class="method-click-advice">click to toggle source</span>
375
+
376
+ </div>
377
+
378
+
379
+ <div class="method-description">
380
+
381
+ <p>Devuelve el % de grasas</p>
382
+
383
+
384
+
385
+
386
+ <div class="method-source-code" id="get_grasas-source">
387
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 59</span>
388
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_grasas</span>
389
+ <span class="ruby-ivar">@informacion</span>[<span class="ruby-value">2</span>]
390
+ <span class="ruby-keyword">end</span></pre>
391
+ </div>
392
+
393
+ </div>
394
+
395
+
396
+
397
+
398
+ </div>
399
+
400
+
401
+ <div id="method-i-get_hidratos" class="method-detail ">
402
+
403
+ <div class="method-heading">
404
+ <span class="method-name">get_hidratos</span><span
405
+ class="method-args">()</span>
406
+
407
+ <span class="method-click-advice">click to toggle source</span>
408
+
409
+ </div>
410
+
411
+
412
+ <div class="method-description">
413
+
414
+ <p>Devuelve el % de hidratos</p>
415
+
416
+
417
+
418
+
419
+ <div class="method-source-code" id="get_hidratos-source">
420
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 64</span>
421
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_hidratos</span>
422
+ <span class="ruby-ivar">@informacion</span>[<span class="ruby-value">3</span>]
423
+ <span class="ruby-keyword">end</span></pre>
424
+ </div>
425
+
426
+ </div>
427
+
428
+
429
+
430
+
431
+ </div>
432
+
433
+
434
+ <div id="method-i-get_ingredientes" class="method-detail ">
435
+
436
+ <div class="method-heading">
437
+ <span class="method-name">get_ingredientes</span><span
438
+ class="method-args">()</span>
439
+
440
+ <span class="method-click-advice">click to toggle source</span>
441
+
442
+ </div>
443
+
444
+
445
+ <div class="method-description">
446
+
447
+ <p>Devuelve el vector de ingredientes</p>
448
+
449
+
450
+
451
+
452
+ <div class="method-source-code" id="get_ingredientes-source">
453
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 44</span>
454
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_ingredientes</span>
455
+ <span class="ruby-ivar">@ingredientes</span>
456
+ <span class="ruby-keyword">end</span></pre>
457
+ </div>
458
+
459
+ </div>
460
+
461
+
462
+
463
+
464
+ </div>
465
+
466
+
467
+ <div id="method-i-get_plato" class="method-detail ">
468
+
469
+ <div class="method-heading">
470
+ <span class="method-name">get_plato</span><span
471
+ class="method-args">(i)</span>
472
+
473
+ <span class="method-click-advice">click to toggle source</span>
474
+
475
+ </div>
476
+
477
+
478
+ <div class="method-description">
479
+
480
+ <p>Devuelve el ingrediente i-esimo del menu</p>
481
+
482
+
483
+
484
+
485
+ <div class="method-source-code" id="get_plato-source">
486
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 39</span>
487
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_plato</span>(<span class="ruby-identifier">i</span>)
488
+ <span class="ruby-ivar">@ingredientes</span>[<span class="ruby-identifier">i</span>]
489
+ <span class="ruby-keyword">end</span></pre>
490
+ </div>
491
+
492
+ </div>
493
+
494
+
495
+
496
+
497
+ </div>
498
+
499
+
500
+ <div id="method-i-get_porcentaje_diario" class="method-detail ">
501
+
502
+ <div class="method-heading">
503
+ <span class="method-name">get_porcentaje_diario</span><span
504
+ class="method-args">()</span>
505
+
506
+ <span class="method-click-advice">click to toggle source</span>
507
+
508
+ </div>
509
+
510
+
511
+ <div class="method-description">
512
+
513
+ <p>Metodo para obtener el % de la ingesta calorica diaria</p>
514
+
515
+
516
+
517
+
518
+ <div class="method-source-code" id="get_porcentaje_diario-source">
519
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 34</span>
520
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_porcentaje_diario</span>
521
+ <span class="ruby-ivar">@descripcion</span>[<span class="ruby-value">1</span>]
522
+ <span class="ruby-keyword">end</span></pre>
523
+ </div>
524
+
525
+ </div>
526
+
527
+
528
+
529
+
530
+ </div>
531
+
532
+
533
+ <div id="method-i-get_proteinas" class="method-detail ">
534
+
535
+ <div class="method-heading">
536
+ <span class="method-name">get_proteinas</span><span
537
+ class="method-args">()</span>
538
+
539
+ <span class="method-click-advice">click to toggle source</span>
540
+
541
+ </div>
542
+
543
+
544
+ <div class="method-description">
545
+
546
+ <p>Devuelve el % de proteinas</p>
547
+
548
+
549
+
550
+
551
+ <div class="method-source-code" id="get_proteinas-source">
552
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 54</span>
553
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_proteinas</span>
554
+ <span class="ruby-ivar">@informacion</span>[<span class="ruby-value">1</span>]
555
+ <span class="ruby-keyword">end</span></pre>
556
+ </div>
557
+
558
+ </div>
559
+
560
+
561
+
562
+
563
+ </div>
564
+
565
+
566
+ <div id="method-i-get_vct" class="method-detail ">
567
+
568
+ <div class="method-heading">
569
+ <span class="method-name">get_vct</span><span
570
+ class="method-args">()</span>
571
+
572
+ <span class="method-click-advice">click to toggle source</span>
573
+
574
+ </div>
575
+
576
+
577
+ <div class="method-description">
578
+
579
+ <p>Devuelve las calorías</p>
580
+
581
+
582
+
583
+
584
+ <div class="method-source-code" id="get_vct-source">
585
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 49</span>
586
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_vct</span>
587
+ <span class="ruby-ivar">@informacion</span>[<span class="ruby-value">0</span>]
588
+ <span class="ruby-keyword">end</span></pre>
589
+ </div>
590
+
591
+ </div>
592
+
593
+
594
+
595
+
596
+ </div>
597
+
598
+
599
+ <div id="method-i-to_s" class="method-detail ">
600
+
601
+ <div class="method-heading">
602
+ <span class="method-name">to_s</span><span
603
+ class="method-args">()</span>
604
+
605
+ <span class="method-click-advice">click to toggle source</span>
606
+
607
+ </div>
608
+
609
+
610
+ <div class="method-description">
611
+
612
+ <p>Metodo para imprimir el menu formateado</p>
613
+
614
+
615
+
616
+
617
+ <div class="method-source-code" id="to_s-source">
618
+ <pre><span class="ruby-comment"># File lib/Dieta/dieta_codigo.rb, line 19</span>
619
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
620
+ <span class="ruby-identifier">output</span> = <span class="ruby-ivar">@descripcion</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-string">&quot; | &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;#{@descripcion[1]}&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;%\n&quot;</span>
621
+ <span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-ivar">@ingredientes</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>
622
+ <span class="ruby-identifier">output</span><span class="ruby-operator">+=</span><span class="ruby-string">&quot;- &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@ingredientes</span>[<span class="ruby-identifier">i</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-string">&quot;: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot; #{@ingredientes[i][1]}, &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot; #{@ingredientes[i][2]} gramos \n&quot;</span>
623
+ <span class="ruby-keyword">end</span>
624
+ <span class="ruby-identifier">output</span><span class="ruby-operator">+=</span> <span class="ruby-string">&quot;V.C.T | % &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;#{@informacion[0]} &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;kcal | &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;#{@informacion[1]}% - #{@informacion[2]}% - #{@informacion[3]}%&quot;</span>
625
+ <span class="ruby-identifier">output</span>
626
+ <span class="ruby-keyword">end</span></pre>
627
+ </div>
628
+
629
+ </div>
630
+
631
+
632
+
633
+
634
+ </div>
635
+
636
+
637
+ </section>
638
+
639
+ </section>
640
+ </main>
641
+
642
+
643
+ <footer id="validator-badges" role="contentinfo">
644
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
645
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.2.
646
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
647
+ </footer>
648
+