P6-alu0101111254 0.1.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
+ SHA256:
3
+ metadata.gz: a01b44d1d70450d234c5eb3bb02b90e9bb00a30499ba02383438e872ca3775f7
4
+ data.tar.gz: e13d5242013fa82d014b870911b270d2050f4e7527aee9870f11e11222666b53
5
+ SHA512:
6
+ metadata.gz: 104cfb7da679418f4a29db1e1d1a2d55d5777c234adc90931579ec2045d807a729fcf71d430ce955fcd78123db8d93167d499bc4e73a42dc05aa3297ad164008
7
+ data.tar.gz: c061d6e0282cab4dec9e718c7d08f8a0d7ff7ebec86c63be1fedd7222783474f37ebbe053ac27f8f66369529371428f94c2e9ad5203ff8a9234640581594b683
data/.coveralls.yml ADDED
@@ -0,0 +1,2 @@
1
+ service_name: travis-pro
2
+ repo_token: XdqbLlXi7UAZ23f0jK3Yk9urIlNUGX90N
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /pkg/
6
+ /spec/reports/
7
+ /tmp/
8
+ /.vs/
9
+ # rspec failure tracking
10
+ .rspec_status
11
+ *~
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.3
7
+ before_install: gem install bundler -v 2.0.2
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'coveralls', require: false
4
+
5
+ # Specify your gem's dependencies in P6.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,93 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ P6-alu0101111254 (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ coderay (1.1.2)
10
+ coveralls (0.8.23)
11
+ json (>= 1.8, < 3)
12
+ simplecov (~> 0.16.1)
13
+ term-ansicolor (~> 1.3)
14
+ thor (>= 0.19.4, < 2.0)
15
+ tins (~> 1.6)
16
+ diff-lcs (1.3)
17
+ docile (1.3.2)
18
+ ffi (1.11.3)
19
+ formatador (0.2.5)
20
+ guard (2.16.1)
21
+ formatador (>= 0.2.4)
22
+ listen (>= 2.7, < 4.0)
23
+ lumberjack (>= 1.0.12, < 2.0)
24
+ nenv (~> 0.1)
25
+ notiffany (~> 0.0)
26
+ pry (>= 0.9.12)
27
+ shellany (~> 0.0)
28
+ thor (>= 0.18.1)
29
+ guard-bundler (2.2.1)
30
+ bundler (>= 1.3.0, < 3)
31
+ guard (~> 2.2)
32
+ guard-compat (~> 1.1)
33
+ guard-compat (1.2.1)
34
+ guard-rspec (4.7.3)
35
+ guard (~> 2.1)
36
+ guard-compat (~> 1.1)
37
+ rspec (>= 2.99.0, < 4.0)
38
+ json (2.3.0)
39
+ listen (3.2.1)
40
+ rb-fsevent (~> 0.10, >= 0.10.3)
41
+ rb-inotify (~> 0.9, >= 0.9.10)
42
+ lumberjack (1.1.0)
43
+ method_source (0.9.2)
44
+ nenv (0.3.0)
45
+ notiffany (0.1.3)
46
+ nenv (~> 0.1)
47
+ shellany (~> 0.0)
48
+ pry (0.12.2)
49
+ coderay (~> 1.1.0)
50
+ method_source (~> 0.9.0)
51
+ rake (10.5.0)
52
+ rb-fsevent (0.10.3)
53
+ rb-inotify (0.10.1)
54
+ ffi (~> 1.0)
55
+ rspec (3.9.0)
56
+ rspec-core (~> 3.9.0)
57
+ rspec-expectations (~> 3.9.0)
58
+ rspec-mocks (~> 3.9.0)
59
+ rspec-core (3.9.1)
60
+ rspec-support (~> 3.9.1)
61
+ rspec-expectations (3.9.0)
62
+ diff-lcs (>= 1.2.0, < 2.0)
63
+ rspec-support (~> 3.9.0)
64
+ rspec-mocks (3.9.1)
65
+ diff-lcs (>= 1.2.0, < 2.0)
66
+ rspec-support (~> 3.9.0)
67
+ rspec-support (3.9.2)
68
+ shellany (0.0.1)
69
+ simplecov (0.16.1)
70
+ docile (~> 1.1)
71
+ json (>= 1.8, < 3)
72
+ simplecov-html (~> 0.10.0)
73
+ simplecov-html (0.10.2)
74
+ term-ansicolor (1.7.1)
75
+ tins (~> 1.0)
76
+ thor (1.0.1)
77
+ tins (1.22.2)
78
+
79
+ PLATFORMS
80
+ ruby
81
+
82
+ DEPENDENCIES
83
+ P6-alu0101111254!
84
+ bundler (~> 2.0)
85
+ coveralls
86
+ guard
87
+ guard-bundler
88
+ guard-rspec
89
+ rake (~> 10.0)
90
+ rspec (~> 3.0)
91
+
92
+ BUNDLED WITH
93
+ 2.0.2
data/Guardfile ADDED
@@ -0,0 +1,84 @@
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.exist?(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
+ watch(%r{^lib/P6/(.+)\.rb$}) {dsl.rspec.spec_dir}
68
+ watch('lib/P6.rb')
69
+
70
+ # Rails config changes
71
+ watch(rails.spec_helper) { rspec.spec_dir }
72
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
73
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
74
+
75
+ # Capybara features specs
76
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
77
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
78
+
79
+ # Turnip features and steps
80
+ watch(%r{^spec/acceptance/(.+)\.feature$})
81
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
82
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
83
+ end
84
+ end
data/P6.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "P6/version"
4
+ Gem::Specification.new do |spec|
5
+ spec.name = "P6-alu0101111254"
6
+ spec.version = P6::VERSION
7
+ spec.authors = ["Lucas Bodson"]
8
+ spec.email = ["alu0101111254@ull.edu.es"]
9
+
10
+ spec.summary = %q{Practica 6 de lpp : TDD.}
11
+ spec.description = %q{Usamos Test Driven Development para generar una clase para almacenar informacion de alimentos y evaluarlas.}
12
+ spec.homepage = "https://github.com/ULL-ESIT-LPP-1920/tdd-alu0101111254"
13
+
14
+ # Specify which files should be added to the gem when it is released.
15
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
16
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
17
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ end
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "guard"
24
+ spec.add_development_dependency "bundler", "~> 2.0"
25
+ spec.add_development_dependency "guard-rspec"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "guard-bundler"
28
+ spec.add_development_dependency "rspec", "~> 3.0"
29
+ end
data/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # P10 LPP
2
+
3
+ ##Lucas Christian Bodson Lobato
4
+
5
+ ##GRUPO:103
6
+
7
+ ##alu01011111254@ull.edu.es
8
+
9
+ En esta práctica seguiremos con el tema de la nutricion, pero esta vez creando una clase menu utilizando la metodología dsl orientada al usuarioy añadiendo travis, coveralls y finalizando el gem
10
+
11
+ ## Travis
12
+ You can see it here https://travis-ci.com/alu0101111254/travis_repository
13
+
14
+ [![Coverage Status](https://coveralls.io/repos/github/alu0101111254/travis_repository/badge.svg?branch=master)](https://coveralls.io/github/alu0101111254/travis_repository?branch=master)
15
+ ## Installacion
16
+
17
+
18
+ $ gem install P6
19
+
20
+ ## Ejecucion
21
+ Se puede ejecutar mediante RAKE o mediante ruby p6_rspec.rb
22
+
23
+ ## TREE
24
+ ```bash
25
+ .
26
+ ├── bin
27
+ │   ├── console
28
+ │   └── setup
29
+ ├── Gemfile
30
+ ├── Gemfile.lock
31
+ ├── Guardfile
32
+ ├── lib
33
+ │   ├── P6
34
+ │   │   ├── P6.rb
35
+ │   │   ├── P7.rb
36
+ │   │   ├── P8.rb
37
+ │   │   └── version.rb
38
+ │   └── P6.rb
39
+ ├── P6.gemspec
40
+ ├── Rakefile
41
+ ├── README.md
42
+ ├── spec
43
+ │   ├── P6_spec.rb
44
+ │   └── spec_helper.rb
45
+ └── tmp.
46
+ ├ Gemfile
47
+ ├ Gemfile.lock
48
+ ├ Guardfile
49
+ ├ P6.gemspec
50
+ ├ README.md
51
+ ├ Rakefile
52
+ ├ bin
53
+ │   ├ console
54
+ │   └ setup
55
+ ├ docs
56
+ │   ├ Alimento.html
57
+ │   ├ BasicPlato.html
58
+ │   ├ Lista.html
59
+ │   ├ Node.html
60
+ │   ├ P6
61
+ │   │   └ Error.html
62
+ │   ├ P6.html
63
+ │   ├ Plato.html
64
+ │   ├ _index.html
65
+ │   ├ class_list.html
66
+ │   ├ css
67
+ │   │   ├ common.css
68
+ │   │   ├ full_list.css
69
+ │   │   └ style.css
70
+ │   ├ file.README.html
71
+ │   ├ file_list.html
72
+ │   ├ frames.html
73
+ │   ├ index.html
74
+ │   ├ js
75
+ │   │   ├ app.js
76
+ │   │   ├ full_list.js
77
+ │   │   └ jquery.js
78
+ │   ├ method_list.html
79
+ │   └ top-level-namespace.html
80
+ ├ lib
81
+ │   ├ P6
82
+ │   │   ├ P6.rb
83
+ │   │   ├ P7.rb
84
+ │   │   ├ P8.rb
85
+ │   │   └ version.rb
86
+ │   └ P6.rb
87
+ ├ spec
88
+ │   ├ P6_spec.rb
89
+ │   └ spec_helper.rb
90
+ └ tmp
91
+ ```
92
+
93
+ ##CONTRIBUTING
94
+
95
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ULL-ESIT-LPP-1920/tdd-alu0101111254.
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 "P6"
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,987 @@
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: Alimento
8
+
9
+ &mdash; Documentation by YARD 0.9.20
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 = "Alimento";
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">Alimento</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: Alimento
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">Alimento</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/P6/P6.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+ <h2>Overview</h2><div class="docstring">
108
+ <div class="discussion">
109
+
110
+ <p>Clase alimento, contiene toda la información nutricional necesaria oara el desarrollo de las practicas</p>
111
+
112
+
113
+ </div>
114
+ </div>
115
+ <div class="tags">
116
+
117
+ <p class="tag_title">Author:</p>
118
+ <ul class="author">
119
+
120
+ <li>
121
+
122
+
123
+
124
+
125
+
126
+ <div class='inline'>
127
+ <p>Lucas Christian Bodson Lobato</p>
128
+ </div>
129
+
130
+ </li>
131
+
132
+ </ul>
133
+
134
+ </div>
135
+
136
+
137
+
138
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
139
+ <ul class="summary">
140
+
141
+ <li class="public ">
142
+ <span class="summary_signature">
143
+
144
+ <a href="#carbos-instance_method" title="#carbos (instance method)">#<strong>carbos</strong> &#x21d2; Object </a>
145
+
146
+
147
+
148
+ </span>
149
+
150
+
151
+
152
+
153
+ <span class="note title readonly">readonly</span>
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+ <span class="summary_desc"><div class='inline'>
164
+ <p>devuelve la cantidad de carbohidratos contenidos en el alimento en gramos.</p>
165
+ </div></span>
166
+
167
+ </li>
168
+
169
+
170
+ <li class="public ">
171
+ <span class="summary_signature">
172
+
173
+ <a href="#gei-instance_method" title="#gei (instance method)">#<strong>gei</strong> &#x21d2; Object </a>
174
+
175
+
176
+
177
+ </span>
178
+
179
+
180
+
181
+
182
+ <span class="note title readonly">readonly</span>
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+ <span class="summary_desc"><div class='inline'>
193
+ <p>devuelve las emisiones de gases diarias de una alimento en kilos.</p>
194
+ </div></span>
195
+
196
+ </li>
197
+
198
+
199
+ <li class="public ">
200
+ <span class="summary_signature">
201
+
202
+ <a href="#lipids-instance_method" title="#lipids (instance method)">#<strong>lipids</strong> &#x21d2; Object </a>
203
+
204
+
205
+
206
+ </span>
207
+
208
+
209
+
210
+
211
+ <span class="note title readonly">readonly</span>
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+ <span class="summary_desc"><div class='inline'>
222
+ <p>devuelve la cantidad de lipidos contenidos en el alimento en gramos.</p>
223
+ </div></span>
224
+
225
+ </li>
226
+
227
+
228
+ <li class="public ">
229
+ <span class="summary_signature">
230
+
231
+ <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
232
+
233
+
234
+
235
+ </span>
236
+
237
+
238
+
239
+
240
+ <span class="note title readonly">readonly</span>
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+ <span class="summary_desc"><div class='inline'>
251
+ <p>devuelve el nombre del alimento.</p>
252
+ </div></span>
253
+
254
+ </li>
255
+
256
+
257
+ <li class="public ">
258
+ <span class="summary_signature">
259
+
260
+ <a href="#proteins-instance_method" title="#proteins (instance method)">#<strong>proteins</strong> &#x21d2; Object </a>
261
+
262
+
263
+
264
+ </span>
265
+
266
+
267
+
268
+
269
+ <span class="note title readonly">readonly</span>
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+ <span class="summary_desc"><div class='inline'>
280
+ <p>devuelve la cantidad de proteinas contenidos en el alimento en gramos.</p>
281
+ </div></span>
282
+
283
+ </li>
284
+
285
+
286
+ <li class="public ">
287
+ <span class="summary_signature">
288
+
289
+ <a href="#terrain-instance_method" title="#terrain (instance method)">#<strong>terrain</strong> &#x21d2; Object </a>
290
+
291
+
292
+
293
+ </span>
294
+
295
+
296
+
297
+
298
+ <span class="note title readonly">readonly</span>
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+ <span class="summary_desc"><div class='inline'>
309
+ <p>devuelve el terreno necesario para cultivar el alimento.</p>
310
+ </div></span>
311
+
312
+ </li>
313
+
314
+
315
+ </ul>
316
+
317
+
318
+
319
+
320
+
321
+ <h2>
322
+ Instance Method Summary
323
+ <small><a href="#" class="summary_toggle">collapse</a></small>
324
+ </h2>
325
+
326
+ <ul class="summary">
327
+
328
+ <li class="public ">
329
+ <span class="summary_signature">
330
+
331
+ <a href="#<=>-instance_method" title="#&lt;=&gt; (instance method)">#<strong>&lt;=&gt;</strong>(another) &#x21d2; Object </a>
332
+
333
+
334
+
335
+ </span>
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+ <span class="summary_desc"><div class='inline'>
346
+ <p>Metodo de comparación, devuelve -1 si es menor que other, +1 si es mayor y 0 si es igual, se utiliza para los mixins de comparable.</p>
347
+ </div></span>
348
+
349
+ </li>
350
+
351
+
352
+ <li class="public ">
353
+ <span class="summary_signature">
354
+
355
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, proteins, carbos, lipids, gei, terrain) &#x21d2; Alimento </a>
356
+
357
+
358
+
359
+ </span>
360
+
361
+
362
+ <span class="note title constructor">constructor</span>
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ <span class="summary_desc"><div class='inline'>
372
+ <p>Construye un objeto alimento segun las especificaciones.</p>
373
+ </div></span>
374
+
375
+ </li>
376
+
377
+
378
+ <li class="public ">
379
+ <span class="summary_signature">
380
+
381
+ <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; Object </a>
382
+
383
+
384
+
385
+ </span>
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+ <span class="summary_desc"><div class='inline'>
396
+ <p>Devuelve todos los valores de alimento formateados como un string.</p>
397
+ </div></span>
398
+
399
+ </li>
400
+
401
+
402
+ <li class="public ">
403
+ <span class="summary_signature">
404
+
405
+ <a href="#val_en-instance_method" title="#val_en (instance method)">#<strong>val_en</strong> &#x21d2; Object </a>
406
+
407
+
408
+
409
+ </span>
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+ <span class="summary_desc"><div class='inline'>
420
+ <p>Devuelve el valor energético del alimento.</p>
421
+ </div></span>
422
+
423
+ </li>
424
+
425
+
426
+ </ul>
427
+
428
+
429
+
430
+ <div id="constructor_details" class="method_details_list">
431
+ <h2>Constructor Details</h2>
432
+
433
+ <div class="method_details first">
434
+ <h3 class="signature first" id="initialize-instance_method">
435
+
436
+ #<strong>initialize</strong>(name, proteins, carbos, lipids, gei, terrain) &#x21d2; <tt><span class='object_link'><a href="" title="Alimento (class)">Alimento</a></span></tt>
437
+
438
+
439
+
440
+
441
+
442
+ </h3><div class="docstring">
443
+ <div class="discussion">
444
+
445
+ <p>Construye un objeto alimento segun las especificaciones</p>
446
+
447
+
448
+ </div>
449
+ </div>
450
+ <div class="tags">
451
+
452
+
453
+ </div><table class="source_code">
454
+ <tr>
455
+ <td>
456
+ <pre class="lines">
457
+
458
+
459
+ 15
460
+ 16
461
+ 17</pre>
462
+ </td>
463
+ <td>
464
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 15</span>
465
+
466
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span><span class='id identifier rubyid_proteins'>proteins</span><span class='comma'>,</span><span class='id identifier rubyid_carbos'>carbos</span><span class='comma'>,</span><span class='id identifier rubyid_lipids'>lipids</span><span class='comma'>,</span><span class='id identifier rubyid_gei'>gei</span><span class='comma'>,</span><span class='id identifier rubyid_terrain'>terrain</span><span class='rparen'>)</span>
467
+ <span class='ivar'>@name</span><span class='comma'>,</span> <span class='ivar'>@proteins</span><span class='comma'>,</span> <span class='ivar'>@carbos</span><span class='comma'>,</span> <span class='ivar'>@lipids</span><span class='comma'>,</span> <span class='ivar'>@gei</span><span class='comma'>,</span> <span class='ivar'>@terrain</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_proteins'>proteins</span><span class='comma'>,</span> <span class='id identifier rubyid_carbos'>carbos</span><span class='comma'>,</span> <span class='id identifier rubyid_lipids'>lipids</span><span class='comma'>,</span> <span class='id identifier rubyid_gei'>gei</span><span class='comma'>,</span> <span class='id identifier rubyid_terrain'>terrain</span>
468
+ <span class='kw'>end</span></pre>
469
+ </td>
470
+ </tr>
471
+ </table>
472
+ </div>
473
+
474
+ </div>
475
+
476
+ <div id="instance_attr_details" class="attr_details">
477
+ <h2>Instance Attribute Details</h2>
478
+
479
+
480
+ <span id=""></span>
481
+ <div class="method_details first">
482
+ <h3 class="signature first" id="carbos-instance_method">
483
+
484
+ #<strong>carbos</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
485
+
486
+
487
+
488
+
489
+
490
+ </h3><div class="docstring">
491
+ <div class="discussion">
492
+
493
+ <p>devuelve la cantidad de carbohidratos contenidos en el alimento en gramos</p>
494
+
495
+
496
+ </div>
497
+ </div>
498
+ <div class="tags">
499
+
500
+ <p class="tag_title">Returns:</p>
501
+ <ul class="return">
502
+
503
+ <li>
504
+
505
+
506
+ <span class='type'>(<tt>Object</tt>)</span>
507
+
508
+
509
+
510
+ &mdash;
511
+ <div class='inline'>
512
+ <p>the current value of carbos</p>
513
+ </div>
514
+
515
+ </li>
516
+
517
+ </ul>
518
+
519
+ </div><table class="source_code">
520
+ <tr>
521
+ <td>
522
+ <pre class="lines">
523
+
524
+
525
+ 9
526
+ 10
527
+ 11</pre>
528
+ </td>
529
+ <td>
530
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 9</span>
531
+
532
+ <span class='kw'>def</span> <span class='id identifier rubyid_carbos'>carbos</span>
533
+ <span class='ivar'>@carbos</span>
534
+ <span class='kw'>end</span></pre>
535
+ </td>
536
+ </tr>
537
+ </table>
538
+ </div>
539
+
540
+
541
+ <span id=""></span>
542
+ <div class="method_details ">
543
+ <h3 class="signature " id="gei-instance_method">
544
+
545
+ #<strong>gei</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
546
+
547
+
548
+
549
+
550
+
551
+ </h3><div class="docstring">
552
+ <div class="discussion">
553
+
554
+ <p>devuelve las emisiones de gases diarias de una alimento en kilos</p>
555
+
556
+
557
+ </div>
558
+ </div>
559
+ <div class="tags">
560
+
561
+ <p class="tag_title">Returns:</p>
562
+ <ul class="return">
563
+
564
+ <li>
565
+
566
+
567
+ <span class='type'>(<tt>Object</tt>)</span>
568
+
569
+
570
+
571
+ &mdash;
572
+ <div class='inline'>
573
+ <p>the current value of gei</p>
574
+ </div>
575
+
576
+ </li>
577
+
578
+ </ul>
579
+
580
+ </div><table class="source_code">
581
+ <tr>
582
+ <td>
583
+ <pre class="lines">
584
+
585
+
586
+ 9
587
+ 10
588
+ 11</pre>
589
+ </td>
590
+ <td>
591
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 9</span>
592
+
593
+ <span class='kw'>def</span> <span class='id identifier rubyid_gei'>gei</span>
594
+ <span class='ivar'>@gei</span>
595
+ <span class='kw'>end</span></pre>
596
+ </td>
597
+ </tr>
598
+ </table>
599
+ </div>
600
+
601
+
602
+ <span id=""></span>
603
+ <div class="method_details ">
604
+ <h3 class="signature " id="lipids-instance_method">
605
+
606
+ #<strong>lipids</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
607
+
608
+
609
+
610
+
611
+
612
+ </h3><div class="docstring">
613
+ <div class="discussion">
614
+
615
+ <p>devuelve la cantidad de lipidos contenidos en el alimento en gramos</p>
616
+
617
+
618
+ </div>
619
+ </div>
620
+ <div class="tags">
621
+
622
+ <p class="tag_title">Returns:</p>
623
+ <ul class="return">
624
+
625
+ <li>
626
+
627
+
628
+ <span class='type'>(<tt>Object</tt>)</span>
629
+
630
+
631
+
632
+ &mdash;
633
+ <div class='inline'>
634
+ <p>the current value of lipids</p>
635
+ </div>
636
+
637
+ </li>
638
+
639
+ </ul>
640
+
641
+ </div><table class="source_code">
642
+ <tr>
643
+ <td>
644
+ <pre class="lines">
645
+
646
+
647
+ 9
648
+ 10
649
+ 11</pre>
650
+ </td>
651
+ <td>
652
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 9</span>
653
+
654
+ <span class='kw'>def</span> <span class='id identifier rubyid_lipids'>lipids</span>
655
+ <span class='ivar'>@lipids</span>
656
+ <span class='kw'>end</span></pre>
657
+ </td>
658
+ </tr>
659
+ </table>
660
+ </div>
661
+
662
+
663
+ <span id=""></span>
664
+ <div class="method_details ">
665
+ <h3 class="signature " id="name-instance_method">
666
+
667
+ #<strong>name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
668
+
669
+
670
+
671
+
672
+
673
+ </h3><div class="docstring">
674
+ <div class="discussion">
675
+
676
+ <p>devuelve el nombre del alimento</p>
677
+
678
+
679
+ </div>
680
+ </div>
681
+ <div class="tags">
682
+
683
+ <p class="tag_title">Returns:</p>
684
+ <ul class="return">
685
+
686
+ <li>
687
+
688
+
689
+ <span class='type'>(<tt>Object</tt>)</span>
690
+
691
+
692
+
693
+ &mdash;
694
+ <div class='inline'>
695
+ <p>the current value of name</p>
696
+ </div>
697
+
698
+ </li>
699
+
700
+ </ul>
701
+
702
+ </div><table class="source_code">
703
+ <tr>
704
+ <td>
705
+ <pre class="lines">
706
+
707
+
708
+ 9
709
+ 10
710
+ 11</pre>
711
+ </td>
712
+ <td>
713
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 9</span>
714
+
715
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
716
+ <span class='ivar'>@name</span>
717
+ <span class='kw'>end</span></pre>
718
+ </td>
719
+ </tr>
720
+ </table>
721
+ </div>
722
+
723
+
724
+ <span id=""></span>
725
+ <div class="method_details ">
726
+ <h3 class="signature " id="proteins-instance_method">
727
+
728
+ #<strong>proteins</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
729
+
730
+
731
+
732
+
733
+
734
+ </h3><div class="docstring">
735
+ <div class="discussion">
736
+
737
+ <p>devuelve la cantidad de proteinas contenidos en el alimento en gramos</p>
738
+
739
+
740
+ </div>
741
+ </div>
742
+ <div class="tags">
743
+
744
+ <p class="tag_title">Returns:</p>
745
+ <ul class="return">
746
+
747
+ <li>
748
+
749
+
750
+ <span class='type'>(<tt>Object</tt>)</span>
751
+
752
+
753
+
754
+ &mdash;
755
+ <div class='inline'>
756
+ <p>the current value of proteins</p>
757
+ </div>
758
+
759
+ </li>
760
+
761
+ </ul>
762
+
763
+ </div><table class="source_code">
764
+ <tr>
765
+ <td>
766
+ <pre class="lines">
767
+
768
+
769
+ 9
770
+ 10
771
+ 11</pre>
772
+ </td>
773
+ <td>
774
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 9</span>
775
+
776
+ <span class='kw'>def</span> <span class='id identifier rubyid_proteins'>proteins</span>
777
+ <span class='ivar'>@proteins</span>
778
+ <span class='kw'>end</span></pre>
779
+ </td>
780
+ </tr>
781
+ </table>
782
+ </div>
783
+
784
+
785
+ <span id=""></span>
786
+ <div class="method_details ">
787
+ <h3 class="signature " id="terrain-instance_method">
788
+
789
+ #<strong>terrain</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
790
+
791
+
792
+
793
+
794
+
795
+ </h3><div class="docstring">
796
+ <div class="discussion">
797
+
798
+ <p>devuelve el terreno necesario para cultivar el alimento</p>
799
+
800
+
801
+ </div>
802
+ </div>
803
+ <div class="tags">
804
+
805
+ <p class="tag_title">Returns:</p>
806
+ <ul class="return">
807
+
808
+ <li>
809
+
810
+
811
+ <span class='type'>(<tt>Object</tt>)</span>
812
+
813
+
814
+
815
+ &mdash;
816
+ <div class='inline'>
817
+ <p>the current value of terrain</p>
818
+ </div>
819
+
820
+ </li>
821
+
822
+ </ul>
823
+
824
+ </div><table class="source_code">
825
+ <tr>
826
+ <td>
827
+ <pre class="lines">
828
+
829
+
830
+ 9
831
+ 10
832
+ 11</pre>
833
+ </td>
834
+ <td>
835
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 9</span>
836
+
837
+ <span class='kw'>def</span> <span class='id identifier rubyid_terrain'>terrain</span>
838
+ <span class='ivar'>@terrain</span>
839
+ <span class='kw'>end</span></pre>
840
+ </td>
841
+ </tr>
842
+ </table>
843
+ </div>
844
+
845
+ </div>
846
+
847
+
848
+ <div id="instance_method_details" class="method_details_list">
849
+ <h2>Instance Method Details</h2>
850
+
851
+
852
+ <div class="method_details first">
853
+ <h3 class="signature first" id="<=>-instance_method">
854
+
855
+ #<strong>&lt;=&gt;</strong>(another) &#x21d2; <tt>Object</tt>
856
+
857
+
858
+
859
+
860
+
861
+ </h3><div class="docstring">
862
+ <div class="discussion">
863
+
864
+ <p>Metodo de comparación, devuelve -1 si es menor que other, +1 si es mayor y 0 si es igual, se utiliza para los mixins de comparable</p>
865
+
866
+
867
+ </div>
868
+ </div>
869
+ <div class="tags">
870
+
871
+
872
+ </div><table class="source_code">
873
+ <tr>
874
+ <td>
875
+ <pre class="lines">
876
+
877
+
878
+ 30
879
+ 31
880
+ 32</pre>
881
+ </td>
882
+ <td>
883
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 30</span>
884
+
885
+ <span class='kw'>def</span> <span class='op'>&lt;=&gt;</span><span class='lparen'>(</span><span class='id identifier rubyid_another'>another</span><span class='rparen'>)</span>
886
+ <span class='kw'>return</span> <span class='id identifier rubyid_val_en'>val_en</span> <span class='op'>&lt;=&gt;</span> <span class='id identifier rubyid_another'>another</span><span class='period'>.</span><span class='id identifier rubyid_val_en'>val_en</span>
887
+ <span class='kw'>end</span></pre>
888
+ </td>
889
+ </tr>
890
+ </table>
891
+ </div>
892
+
893
+ <div class="method_details ">
894
+ <h3 class="signature " id="to_s-instance_method">
895
+
896
+ #<strong>to_s</strong> &#x21d2; <tt>Object</tt>
897
+
898
+
899
+
900
+
901
+
902
+ </h3><div class="docstring">
903
+ <div class="discussion">
904
+
905
+ <p>Devuelve todos los valores de alimento formateados como un string</p>
906
+
907
+
908
+ </div>
909
+ </div>
910
+ <div class="tags">
911
+
912
+
913
+ </div><table class="source_code">
914
+ <tr>
915
+ <td>
916
+ <pre class="lines">
917
+
918
+
919
+ 20
920
+ 21
921
+ 22</pre>
922
+ </td>
923
+ <td>
924
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 20</span>
925
+
926
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='rparen'>)</span>
927
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Nombre: </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> Proteínas: </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='ivar'>@proteins</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> Carbohidratos: </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='ivar'>@carbos</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> Lípidos: </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='ivar'>@lipids</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> GEI: </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_gei'>gei</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> Terreno: </span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_terrain'>terrain</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
928
+ <span class='kw'>end</span></pre>
929
+ </td>
930
+ </tr>
931
+ </table>
932
+ </div>
933
+
934
+ <div class="method_details ">
935
+ <h3 class="signature " id="val_en-instance_method">
936
+
937
+ #<strong>val_en</strong> &#x21d2; <tt>Object</tt>
938
+
939
+
940
+
941
+
942
+
943
+ </h3><div class="docstring">
944
+ <div class="discussion">
945
+
946
+ <p>Devuelve el valor energético del alimento</p>
947
+
948
+
949
+ </div>
950
+ </div>
951
+ <div class="tags">
952
+
953
+
954
+ </div><table class="source_code">
955
+ <tr>
956
+ <td>
957
+ <pre class="lines">
958
+
959
+
960
+ 25
961
+ 26
962
+ 27</pre>
963
+ </td>
964
+ <td>
965
+ <pre class="code"><span class="info file"># File 'lib/P6/P6.rb', line 25</span>
966
+
967
+ <span class='kw'>def</span> <span class='id identifier rubyid_val_en'>val_en</span><span class='lparen'>(</span><span class='rparen'>)</span>
968
+ <span class='lparen'>(</span><span class='ivar'>@carbos</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'>@lipids</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'>@proteins</span><span class='op'>*</span><span class='int'>4</span><span class='rparen'>)</span>
969
+ <span class='kw'>end</span></pre>
970
+ </td>
971
+ </tr>
972
+ </table>
973
+ </div>
974
+
975
+ </div>
976
+
977
+ </div>
978
+
979
+ <div id="footer">
980
+ Generated on Thu Dec 19 17:41:57 2019 by
981
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
982
+ 0.9.20 (ruby-2.6.3).
983
+ </div>
984
+
985
+ </div>
986
+ </body>
987
+ </html>