alimentacion 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +95 -0
- data/Guardfile +82 -0
- data/README.md +9 -0
- data/Rakefile +6 -0
- data/alimentacion.gemspec +38 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Alimentacion.html +110 -0
- data/docs/Alimentacion/Error.html +103 -0
- data/docs/Alimentos.html +529 -0
- data/docs/Eficiencia_Energetica.html +484 -0
- data/docs/Gemfile.html +98 -0
- data/docs/Gemfile_lock.html +177 -0
- data/docs/Guardfile.html +165 -0
- data/docs/Lista.html +622 -0
- data/docs/Object.html +127 -0
- data/docs/Plato.html +504 -0
- data/docs/README_md.html +104 -0
- data/docs/Rakefile.html +100 -0
- data/docs/alimentacion_gemspec.html +132 -0
- data/docs/bin/setup.html +100 -0
- data/docs/created.rid +16 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +590 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +117 -0
- data/docs/js/darkfish.js +161 -0
- data/docs/js/jquery.js +4 -0
- data/docs/js/navigation.js +141 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +109 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +293 -0
- data/lib/alimentacion.rb +11 -0
- data/lib/alimentacion/alimentos.rb +65 -0
- data/lib/alimentacion/lista.rb +136 -0
- data/lib/alimentacion/menu_dsl.rb +36 -0
- data/lib/alimentacion/plato_dsl.rb +45 -0
- data/lib/alimentacion/platos.rb +199 -0
- data/lib/alimentacion/version.rb +3 -0
- metadata +221 -0
data/docs/Gemfile.html
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>Gemfile - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="file">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="project-metadata">
|
58
|
+
<div id="fileindex-section" class="nav-section">
|
59
|
+
<h3>Pages</h3>
|
60
|
+
|
61
|
+
<ul class="link-list">
|
62
|
+
|
63
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
64
|
+
|
65
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
66
|
+
|
67
|
+
<li><a href="./Guardfile.html">Guardfile</a>
|
68
|
+
|
69
|
+
<li><a href="./README_md.html">README</a>
|
70
|
+
|
71
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
72
|
+
|
73
|
+
<li><a href="./alimentacion_gemspec.html">alimentacion.gemspec</a>
|
74
|
+
|
75
|
+
<li><a href="./bin/setup.html">setup</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-label="Page Gemfile">
|
84
|
+
|
85
|
+
<p>source “<a href="https://rubygems.org">rubygems.org</a>”</p>
|
86
|
+
|
87
|
+
<p># Specify your gem's dependencies in <a href="alimentacion_gemspec.html">alimentacion.gemspec</a> gemspec</p>
|
88
|
+
|
89
|
+
</main>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<footer id="validator-badges" role="contentinfo">
|
94
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
95
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
96
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
97
|
+
</footer>
|
98
|
+
|
@@ -0,0 +1,177 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>Gemfile.lock - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="file">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="project-metadata">
|
58
|
+
<div id="fileindex-section" class="nav-section">
|
59
|
+
<h3>Pages</h3>
|
60
|
+
|
61
|
+
<ul class="link-list">
|
62
|
+
|
63
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
64
|
+
|
65
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
66
|
+
|
67
|
+
<li><a href="./Guardfile.html">Guardfile</a>
|
68
|
+
|
69
|
+
<li><a href="./README_md.html">README</a>
|
70
|
+
|
71
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
72
|
+
|
73
|
+
<li><a href="./alimentacion_gemspec.html">alimentacion.gemspec</a>
|
74
|
+
|
75
|
+
<li><a href="./bin/setup.html">setup</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-label="Page Gemfile.lock">
|
84
|
+
|
85
|
+
<p>PATH</p>
|
86
|
+
|
87
|
+
<pre>remote: .
|
88
|
+
specs:
|
89
|
+
alimentacion (0.1.0)</pre>
|
90
|
+
|
91
|
+
<p>GEM</p>
|
92
|
+
|
93
|
+
<pre>remote: https://rubygems.org/
|
94
|
+
specs:
|
95
|
+
coderay (1.1.2)
|
96
|
+
diff-lcs (1.3)
|
97
|
+
ffi (1.11.2)
|
98
|
+
formatador (0.2.5)
|
99
|
+
guard (2.16.1)
|
100
|
+
formatador (>= 0.2.4)
|
101
|
+
listen (>= 2.7, < 4.0)
|
102
|
+
lumberjack (>= 1.0.12, < 2.0)
|
103
|
+
nenv (~> 0.1)
|
104
|
+
notiffany (~> 0.0)
|
105
|
+
pry (>= 0.9.12)
|
106
|
+
shellany (~> 0.0)
|
107
|
+
thor (>= 0.18.1)
|
108
|
+
guard-bundler (2.2.1)
|
109
|
+
bundler (>= 1.3.0, < 3)
|
110
|
+
guard (~> 2.2)
|
111
|
+
guard-compat (~> 1.1)
|
112
|
+
guard-compat (1.2.1)
|
113
|
+
guard-rspec (4.7.3)
|
114
|
+
guard (~> 2.1)
|
115
|
+
guard-compat (~> 1.1)
|
116
|
+
rspec (>= 2.99.0, < 4.0)
|
117
|
+
listen (3.2.0)
|
118
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
119
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
120
|
+
lumberjack (1.0.13)
|
121
|
+
method_source (0.9.2)
|
122
|
+
nenv (0.3.0)
|
123
|
+
notiffany (0.1.3)
|
124
|
+
nenv (~> 0.1)
|
125
|
+
shellany (~> 0.0)
|
126
|
+
pry (0.12.2)
|
127
|
+
coderay (~> 1.1.0)
|
128
|
+
method_source (~> 0.9.0)
|
129
|
+
rake (10.5.0)
|
130
|
+
rb-fsevent (0.10.3)
|
131
|
+
rb-inotify (0.10.0)
|
132
|
+
ffi (~> 1.0)
|
133
|
+
rspec (3.9.0)
|
134
|
+
rspec-core (~> 3.9.0)
|
135
|
+
rspec-expectations (~> 3.9.0)
|
136
|
+
rspec-mocks (~> 3.9.0)
|
137
|
+
rspec-core (3.9.0)
|
138
|
+
rspec-support (~> 3.9.0)
|
139
|
+
rspec-expectations (3.9.0)
|
140
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
141
|
+
rspec-support (~> 3.9.0)
|
142
|
+
rspec-mocks (3.9.0)
|
143
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
144
|
+
rspec-support (~> 3.9.0)
|
145
|
+
rspec-support (3.9.0)
|
146
|
+
shellany (0.0.1)
|
147
|
+
thor (0.20.3)</pre>
|
148
|
+
|
149
|
+
<p>PLATFORMS</p>
|
150
|
+
|
151
|
+
<pre class="ruby"><span class="ruby-identifier">ruby</span>
|
152
|
+
</pre>
|
153
|
+
|
154
|
+
<p>DEPENDENCIES</p>
|
155
|
+
|
156
|
+
<pre>alimentacion!
|
157
|
+
bundler (~> 2.0)
|
158
|
+
guard
|
159
|
+
guard-bundler
|
160
|
+
guard-rspec
|
161
|
+
rake (~> 10.0)
|
162
|
+
rspec (~> 3.0)</pre>
|
163
|
+
|
164
|
+
<p>BUNDLED WITH</p>
|
165
|
+
|
166
|
+
<pre>2.0.2</pre>
|
167
|
+
|
168
|
+
</main>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<footer id="validator-badges" role="contentinfo">
|
173
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
174
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
175
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
176
|
+
</footer>
|
177
|
+
|
data/docs/Guardfile.html
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>Guardfile - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="file">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="project-metadata">
|
58
|
+
<div id="fileindex-section" class="nav-section">
|
59
|
+
<h3>Pages</h3>
|
60
|
+
|
61
|
+
<ul class="link-list">
|
62
|
+
|
63
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
64
|
+
|
65
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
66
|
+
|
67
|
+
<li><a href="./Guardfile.html">Guardfile</a>
|
68
|
+
|
69
|
+
<li><a href="./README_md.html">README</a>
|
70
|
+
|
71
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
72
|
+
|
73
|
+
<li><a href="./alimentacion_gemspec.html">alimentacion.gemspec</a>
|
74
|
+
|
75
|
+
<li><a href="./bin/setup.html">setup</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-label="Page Guardfile">
|
84
|
+
|
85
|
+
<p># A sample <a href="Guardfile.html">Guardfile</a> # More info at <a href="https://github.com/guard/guard#readme">github.com/guard/guard#readme</a></p>
|
86
|
+
|
87
|
+
<p>## Uncomment and set this to only include directories you want to watch # directories %w(app lib config test spec features) \ # .select{|d| Dir.exist?(d) ? d : UI.warning(“Directory #{d} does not exist”)}</p>
|
88
|
+
|
89
|
+
<p>## Note: if you are using the `directories` clause above and you are not ## watching the project directory ('.'), then you will want to move ## the <a href="Guardfile.html">Guardfile</a> to a watched dir and symlink it back, e.g. # # $ mkdir config # $ mv <a href="Guardfile.html">Guardfile</a> config/ # $ ln -s config/Guardfile . # # and, you'll have to watch “config/Guardfile” instead of “Guardfile”</p>
|
90
|
+
|
91
|
+
<p>guard :bundler do</p>
|
92
|
+
|
93
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'guard/bundler'</span>
|
94
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'guard/bundler/verify'</span>
|
95
|
+
<span class="ruby-identifier">helper</span> = <span class="ruby-constant">Guard</span><span class="ruby-operator">::</span><span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Verify</span>.<span class="ruby-identifier">new</span>
|
96
|
+
|
97
|
+
<span class="ruby-identifier">files</span> = [<span class="ruby-string">'Gemfile'</span>]
|
98
|
+
<span class="ruby-identifier">files</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Dir</span>[<span class="ruby-string">'*.gemspec'</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">files</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">helper</span>.<span class="ruby-identifier">uses_gemspec?</span>(<span class="ruby-identifier">f</span>) }
|
99
|
+
|
100
|
+
<span class="ruby-comment"># Assume files are symlinked from somewhere</span>
|
101
|
+
<span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">watch</span>(<span class="ruby-identifier">helper</span>.<span class="ruby-identifier">real_path</span>(<span class="ruby-identifier">file</span>)) }
|
102
|
+
</pre>
|
103
|
+
|
104
|
+
<p>end</p>
|
105
|
+
|
106
|
+
<p># Note: The cmd option is now required due to the increasing number of ways # rspec may be run, below are examples of the most common uses. # * bundler: 'bundle exec rspec' # * bundler binstubs: 'bin/rspec' # * spring: 'bin/rspec' (This will use spring if running and you have # installed the spring binstubs per the docs) # * zeus: 'zeus rspec' (requires the server to be started separately) # * 'just' rspec: 'rspec'</p>
|
107
|
+
|
108
|
+
<p>guard :rspec, cmd: “bundle exec rspec” do</p>
|
109
|
+
|
110
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"guard/rspec/dsl"</span>
|
111
|
+
<span class="ruby-identifier">dsl</span> = <span class="ruby-constant">Guard</span><span class="ruby-operator">::</span><span class="ruby-constant">RSpec</span><span class="ruby-operator">::</span><span class="ruby-constant">Dsl</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>)
|
112
|
+
|
113
|
+
<span class="ruby-comment"># Feel free to open issues for suggestions and improvements</span>
|
114
|
+
|
115
|
+
<span class="ruby-comment"># RSpec files</span>
|
116
|
+
<span class="ruby-identifier">rspec</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">rspec</span>
|
117
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_helper</span>) { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
|
118
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_support</span>) { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
|
119
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_files</span>)
|
120
|
+
|
121
|
+
<span class="ruby-comment"># Ruby files</span>
|
122
|
+
<span class="ruby-identifier">ruby</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">ruby</span>
|
123
|
+
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">ruby</span>.<span class="ruby-identifier">lib_files</span>)
|
124
|
+
|
125
|
+
<span class="ruby-comment"># Rails files</span>
|
126
|
+
<span class="ruby-identifier">rails</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">rails</span>(<span class="ruby-value">view_extensions:</span> <span class="ruby-node">%w(erb haml slim)</span>)
|
127
|
+
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">app_files</span>)
|
128
|
+
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">views</span>)
|
129
|
+
|
130
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">controllers</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
|
131
|
+
[
|
132
|
+
<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"routing/#{m[1]}_routing"</span>),
|
133
|
+
<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"controllers/#{m[1]}_controller"</span>),
|
134
|
+
<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"acceptance/#{m[1]}"</span>)
|
135
|
+
]
|
136
|
+
<span class="ruby-keyword">end</span>
|
137
|
+
|
138
|
+
<span class="ruby-comment"># Rails config changes</span>
|
139
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">spec_helper</span>) { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
|
140
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">routes</span>) { <span class="ruby-node">"#{rspec.spec_dir}/routing"</span> }
|
141
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">app_controller</span>) { <span class="ruby-node">"#{rspec.spec_dir}/controllers"</span> }
|
142
|
+
|
143
|
+
<span class="ruby-comment"># Capybara features specs</span>
|
144
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">view_dirs</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"features/#{m[1]}"</span>) }
|
145
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">layouts</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"features/#{m[1]}"</span>) }
|
146
|
+
|
147
|
+
<span class="ruby-comment"># Turnip features and steps</span>
|
148
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-regexp">%r{^spec/acceptance/(.+)\.feature$}</span>)
|
149
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-regexp">%r{^spec/acceptance/steps/(.+)_steps\.rb$}</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
|
150
|
+
<span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-node">"**/#{m[1]}.feature"</span>)][<span class="ruby-value">0</span>] <span class="ruby-operator">||</span> <span class="ruby-string">"spec/acceptance"</span>
|
151
|
+
<span class="ruby-keyword">end</span>
|
152
|
+
</pre>
|
153
|
+
|
154
|
+
<p>end</p>
|
155
|
+
|
156
|
+
</main>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<footer id="validator-badges" role="contentinfo">
|
161
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
162
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
163
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
164
|
+
</footer>
|
165
|
+
|
data/docs/Lista.html
ADDED
@@ -0,0 +1,622 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Lista - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="class">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<div id="parent-class-section" class="nav-section">
|
60
|
+
<h3>Parent</h3>
|
61
|
+
|
62
|
+
|
63
|
+
<p class="link"><a href="Object.html">Object</a>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div id="includes-section" class="nav-section">
|
68
|
+
<h3>Included Modules</h3>
|
69
|
+
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
|
73
|
+
<li><span class="include">Enumerable</span>
|
74
|
+
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
<!-- Method Quickref -->
|
81
|
+
<div id="method-list-section" class="nav-section">
|
82
|
+
<h3>Methods</h3>
|
83
|
+
|
84
|
+
<ul class="link-list" role="directory">
|
85
|
+
|
86
|
+
<li ><a href="#method-c-new">::new</a>
|
87
|
+
|
88
|
+
<li ><a href="#method-i-dieta_gases_anuales">#dieta_gases_anuales</a>
|
89
|
+
|
90
|
+
<li ><a href="#method-i-dieta_gases_diarios">#dieta_gases_diarios</a>
|
91
|
+
|
92
|
+
<li ><a href="#method-i-dieta_terreno">#dieta_terreno</a>
|
93
|
+
|
94
|
+
<li ><a href="#method-i-each">#each</a>
|
95
|
+
|
96
|
+
<li ><a href="#method-i-extract_head">#extract_head</a>
|
97
|
+
|
98
|
+
<li ><a href="#method-i-extract_tail">#extract_tail</a>
|
99
|
+
|
100
|
+
<li ><a href="#method-i-imprimir">#imprimir</a>
|
101
|
+
|
102
|
+
<li ><a href="#method-i-insert">#insert</a>
|
103
|
+
|
104
|
+
<li ><a href="#method-i-insert_head">#insert_head</a>
|
105
|
+
|
106
|
+
<li ><a href="#method-i-insert_tail">#insert_tail</a>
|
107
|
+
|
108
|
+
</ul>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</nav>
|
113
|
+
|
114
|
+
<main role="main" aria-labelledby="class-Lista">
|
115
|
+
<h1 id="class-Lista" class="class">
|
116
|
+
class Lista
|
117
|
+
</h1>
|
118
|
+
|
119
|
+
<section class="description">
|
120
|
+
|
121
|
+
</section>
|
122
|
+
|
123
|
+
|
124
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<section class="attribute-method-details" class="method-section">
|
133
|
+
<header>
|
134
|
+
<h3>Attributes</h3>
|
135
|
+
</header>
|
136
|
+
|
137
|
+
|
138
|
+
<div id="attribute-i-head" class="method-detail">
|
139
|
+
<div class="method-heading attribute-method-heading">
|
140
|
+
<span class="method-name">head</span><span
|
141
|
+
class="attribute-access-type">[RW]</span>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<div class="method-description">
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<div id="attribute-i-tail" class="method-detail">
|
152
|
+
<div class="method-heading attribute-method-heading">
|
153
|
+
<span class="method-name">tail</span><span
|
154
|
+
class="attribute-access-type">[RW]</span>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div class="method-description">
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
</section>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
169
|
+
<header>
|
170
|
+
<h3>Public Class Methods</h3>
|
171
|
+
</header>
|
172
|
+
|
173
|
+
|
174
|
+
<div id="method-c-new" class="method-detail ">
|
175
|
+
|
176
|
+
<div class="method-heading">
|
177
|
+
<span class="method-name">new</span><span
|
178
|
+
class="method-args">(head,tail)</span>
|
179
|
+
|
180
|
+
<span class="method-click-advice">click to toggle source</span>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
<div class="method-description">
|
186
|
+
|
187
|
+
<p>Se asignan la cabecera de la lista y la cola de la lista. Inicialmente apuntan a nil.</p>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
<div class="method-source-code" id="new-source">
|
193
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 26</span>
|
194
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">head</span>,<span class="ruby-identifier">tail</span>)
|
195
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-keyword">nil</span>
|
196
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-keyword">nil</span>
|
197
|
+
<span class="ruby-keyword">end</span></pre>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
</div>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
</section>
|
209
|
+
|
210
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
211
|
+
<header>
|
212
|
+
<h3>Public Instance Methods</h3>
|
213
|
+
</header>
|
214
|
+
|
215
|
+
|
216
|
+
<div id="method-i-dieta_gases_anuales" class="method-detail ">
|
217
|
+
|
218
|
+
<div class="method-heading">
|
219
|
+
<span class="method-name">dieta_gases_anuales</span><span
|
220
|
+
class="method-args">(gramos)</span>
|
221
|
+
|
222
|
+
<span class="method-click-advice">click to toggle source</span>
|
223
|
+
|
224
|
+
</div>
|
225
|
+
|
226
|
+
|
227
|
+
<div class="method-description">
|
228
|
+
|
229
|
+
<p>Calcula el total de gases anuales que tiene la lista de alimentos</p>
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
<div class="method-source-code" id="dieta_gases_anuales-source">
|
235
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 102</span>
|
236
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dieta_gases_anuales</span>(<span class="ruby-identifier">gramos</span>)
|
237
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
238
|
+
<span class="ruby-identifier">suma_gases</span> = <span class="ruby-value">0</span>
|
239
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
240
|
+
<span class="ruby-keyword">while</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">aux</span>.<span class="ruby-identifier">nil?</span>)
|
241
|
+
<span class="ruby-identifier">suma_gases</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:value</span>].<span class="ruby-identifier">auxiliar</span>(<span class="ruby-identifier">gramos</span>[<span class="ruby-identifier">i</span>])
|
242
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
243
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">i</span><span class="ruby-value">+1</span>
|
244
|
+
<span class="ruby-keyword">end</span>
|
245
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">suma_gases</span>.<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
|
246
|
+
|
247
|
+
<span class="ruby-keyword">end</span></pre>
|
248
|
+
</div>
|
249
|
+
|
250
|
+
</div>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</div>
|
256
|
+
|
257
|
+
|
258
|
+
<div id="method-i-dieta_gases_diarios" class="method-detail ">
|
259
|
+
|
260
|
+
<div class="method-heading">
|
261
|
+
<span class="method-name">dieta_gases_diarios</span><span
|
262
|
+
class="method-args">(gramos)</span>
|
263
|
+
|
264
|
+
<span class="method-click-advice">click to toggle source</span>
|
265
|
+
|
266
|
+
</div>
|
267
|
+
|
268
|
+
|
269
|
+
<div class="method-description">
|
270
|
+
|
271
|
+
<p>Calcula el total de gases diarios que tiene la lista de alimentos</p>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
<div class="method-source-code" id="dieta_gases_diarios-source">
|
277
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 116</span>
|
278
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dieta_gases_diarios</span>(<span class="ruby-identifier">gramos</span>)
|
279
|
+
<span class="ruby-identifier">gases_diarios</span> = <span class="ruby-identifier">dieta_gases_anuales</span>(<span class="ruby-identifier">gramos</span>)<span class="ruby-operator">/</span><span class="ruby-value">365</span>
|
280
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">gases_diarios</span>.<span class="ruby-identifier">round</span>(<span class="ruby-value">3</span>)
|
281
|
+
<span class="ruby-keyword">end</span></pre>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
</div>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
|
292
|
+
<div id="method-i-dieta_terreno" class="method-detail ">
|
293
|
+
|
294
|
+
<div class="method-heading">
|
295
|
+
<span class="method-name">dieta_terreno</span><span
|
296
|
+
class="method-args">(gramos)</span>
|
297
|
+
|
298
|
+
<span class="method-click-advice">click to toggle source</span>
|
299
|
+
|
300
|
+
</div>
|
301
|
+
|
302
|
+
|
303
|
+
<div class="method-description">
|
304
|
+
|
305
|
+
<p>Calcula el total de uso del terreno que tiene la lista de alimentos</p>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
<div class="method-source-code" id="dieta_terreno-source">
|
311
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 122</span>
|
312
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dieta_terreno</span>(<span class="ruby-identifier">gramos</span>)
|
313
|
+
|
314
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
315
|
+
<span class="ruby-identifier">suma_terreno</span> = <span class="ruby-value">0</span>
|
316
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
317
|
+
<span class="ruby-keyword">while</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">aux</span>.<span class="ruby-identifier">nil?</span>)
|
318
|
+
<span class="ruby-identifier">suma_terreno</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:value</span>].<span class="ruby-identifier">auxiliar2</span>(<span class="ruby-identifier">gramos</span>[<span class="ruby-identifier">i</span>])
|
319
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
320
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">i</span><span class="ruby-value">+1</span>
|
321
|
+
<span class="ruby-keyword">end</span>
|
322
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">suma_terreno</span>.<span class="ruby-identifier">round</span>(<span class="ruby-value">2</span>)
|
323
|
+
|
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-each" class="method-detail ">
|
336
|
+
|
337
|
+
<div class="method-heading">
|
338
|
+
<span class="method-name">each</span><span
|
339
|
+
class="method-args">() { |aux| ... }</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>Se utiliza el módulo Enumerable, para enumerar cualquier lista enlazada.</p>
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
<div class="method-source-code" id="each-source">
|
354
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 15</span>
|
355
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">each</span>
|
356
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
357
|
+
<span class="ruby-keyword">while</span> <span class="ruby-operator">!</span><span class="ruby-identifier">aux</span>.<span class="ruby-identifier">nil?</span>
|
358
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:value</span>]
|
359
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
360
|
+
<span class="ruby-keyword">end</span>
|
361
|
+
<span class="ruby-keyword">end</span></pre>
|
362
|
+
</div>
|
363
|
+
|
364
|
+
</div>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
</div>
|
370
|
+
|
371
|
+
|
372
|
+
<div id="method-i-extract_head" class="method-detail ">
|
373
|
+
|
374
|
+
<div class="method-heading">
|
375
|
+
<span class="method-name">extract_head</span><span
|
376
|
+
class="method-args">()</span>
|
377
|
+
|
378
|
+
<span class="method-click-advice">click to toggle source</span>
|
379
|
+
|
380
|
+
</div>
|
381
|
+
|
382
|
+
|
383
|
+
<div class="method-description">
|
384
|
+
|
385
|
+
<p>Se extrae el nodo situado en la cabeza de la lista</p>
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
<div class="method-source-code" id="extract_head-source">
|
391
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 54</span>
|
392
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">extract_head</span>()
|
393
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">nil?</span>
|
394
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-string">"La lista está vacía"</span>
|
395
|
+
<span class="ruby-keyword">else</span>
|
396
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@tail</span>
|
397
|
+
<span class="ruby-ivar">@head</span>, <span class="ruby-ivar">@tail</span> = <span class="ruby-keyword">nil</span>
|
398
|
+
<span class="ruby-keyword">else</span>
|
399
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-ivar">@head</span>[<span class="ruby-value">:next</span>]
|
400
|
+
<span class="ruby-ivar">@head</span>[<span class="ruby-value">:prev</span>] = <span class="ruby-keyword">nil</span>
|
401
|
+
<span class="ruby-keyword">end</span>
|
402
|
+
|
403
|
+
<span class="ruby-keyword">end</span>
|
404
|
+
<span class="ruby-keyword">end</span></pre>
|
405
|
+
</div>
|
406
|
+
|
407
|
+
</div>
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
</div>
|
413
|
+
|
414
|
+
|
415
|
+
<div id="method-i-extract_tail" class="method-detail ">
|
416
|
+
|
417
|
+
<div class="method-heading">
|
418
|
+
<span class="method-name">extract_tail</span><span
|
419
|
+
class="method-args">()</span>
|
420
|
+
|
421
|
+
<span class="method-click-advice">click to toggle source</span>
|
422
|
+
|
423
|
+
</div>
|
424
|
+
|
425
|
+
|
426
|
+
<div class="method-description">
|
427
|
+
|
428
|
+
<p>Se extrae el nodo situado en la cola de la lista</p>
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
<div class="method-source-code" id="extract_tail-source">
|
434
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 69</span>
|
435
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">extract_tail</span>()
|
436
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">nil?</span>
|
437
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-string">"La lista está vacía"</span>
|
438
|
+
<span class="ruby-keyword">else</span>
|
439
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@tail</span>
|
440
|
+
<span class="ruby-ivar">@head</span>, <span class="ruby-ivar">@tail</span> = <span class="ruby-keyword">nil</span>
|
441
|
+
<span class="ruby-keyword">else</span>
|
442
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-ivar">@tail</span>[<span class="ruby-value">:prev</span>]
|
443
|
+
<span class="ruby-ivar">@tail</span>[<span class="ruby-value">:next</span>] = <span class="ruby-keyword">nil</span>
|
444
|
+
<span class="ruby-keyword">end</span>
|
445
|
+
<span class="ruby-keyword">end</span>
|
446
|
+
<span class="ruby-keyword">end</span></pre>
|
447
|
+
</div>
|
448
|
+
|
449
|
+
</div>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
</div>
|
455
|
+
|
456
|
+
|
457
|
+
<div id="method-i-imprimir" class="method-detail ">
|
458
|
+
|
459
|
+
<div class="method-heading">
|
460
|
+
<span class="method-name">imprimir</span><span
|
461
|
+
class="method-args">()</span>
|
462
|
+
|
463
|
+
<span class="method-click-advice">click to toggle source</span>
|
464
|
+
|
465
|
+
</div>
|
466
|
+
|
467
|
+
|
468
|
+
<div class="method-description">
|
469
|
+
|
470
|
+
<p>Se visualiza la lista</p>
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
<div class="method-source-code" id="imprimir-source">
|
476
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 90</span>
|
477
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">imprimir</span>
|
478
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
479
|
+
<span class="ruby-identifier">lista</span> = []
|
480
|
+
<span class="ruby-keyword">while</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">aux</span>.<span class="ruby-identifier">nil?</span>)
|
481
|
+
<span class="ruby-identifier">lista</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:value</span>].<span class="ruby-identifier">to_s</span>
|
482
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
483
|
+
<span class="ruby-keyword">end</span>
|
484
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">lista</span>
|
485
|
+
|
486
|
+
<span class="ruby-keyword">end</span></pre>
|
487
|
+
</div>
|
488
|
+
|
489
|
+
</div>
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
</div>
|
495
|
+
|
496
|
+
|
497
|
+
<div id="method-i-insert" class="method-detail ">
|
498
|
+
|
499
|
+
<div class="method-heading">
|
500
|
+
<span class="method-name">insert</span><span
|
501
|
+
class="method-args">(nodos)</span>
|
502
|
+
|
503
|
+
<span class="method-click-advice">click to toggle source</span>
|
504
|
+
|
505
|
+
</div>
|
506
|
+
|
507
|
+
|
508
|
+
<div class="method-description">
|
509
|
+
|
510
|
+
<p>Se insertan por la cola un conjunto de nodos</p>
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
<div class="method-source-code" id="insert-source">
|
516
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 83</span>
|
517
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert</span>(<span class="ruby-identifier">nodos</span>)
|
518
|
+
<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-identifier">nodos</span>.<span class="ruby-identifier">size</span><span class="ruby-value">-1</span>)
|
519
|
+
<span class="ruby-identifier">insert_tail</span>(<span class="ruby-identifier">nodos</span>[<span class="ruby-identifier">i</span>])
|
520
|
+
<span class="ruby-keyword">end</span>
|
521
|
+
<span class="ruby-keyword">end</span></pre>
|
522
|
+
</div>
|
523
|
+
|
524
|
+
</div>
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
</div>
|
530
|
+
|
531
|
+
|
532
|
+
<div id="method-i-insert_head" class="method-detail ">
|
533
|
+
|
534
|
+
<div class="method-heading">
|
535
|
+
<span class="method-name">insert_head</span><span
|
536
|
+
class="method-args">(value)</span>
|
537
|
+
|
538
|
+
<span class="method-click-advice">click to toggle source</span>
|
539
|
+
|
540
|
+
</div>
|
541
|
+
|
542
|
+
|
543
|
+
<div class="method-description">
|
544
|
+
|
545
|
+
<p>Se inserta un nodo por la cabeza de la lista</p>
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
<div class="method-source-code" id="insert_head-source">
|
551
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 32</span>
|
552
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_head</span>(<span class="ruby-identifier">value</span>)
|
553
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">nil?</span>
|
554
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-constant">Nodo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
555
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-ivar">@head</span>
|
556
|
+
<span class="ruby-keyword">else</span>
|
557
|
+
<span class="ruby-ivar">@head</span>[<span class="ruby-value">:prev</span>] = <span class="ruby-constant">Nodo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>, <span class="ruby-ivar">@head</span>, <span class="ruby-keyword">nil</span>)
|
558
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-ivar">@head</span>[<span class="ruby-value">:prev</span>]
|
559
|
+
<span class="ruby-keyword">end</span>
|
560
|
+
<span class="ruby-keyword">end</span></pre>
|
561
|
+
</div>
|
562
|
+
|
563
|
+
</div>
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
</div>
|
569
|
+
|
570
|
+
|
571
|
+
<div id="method-i-insert_tail" class="method-detail ">
|
572
|
+
|
573
|
+
<div class="method-heading">
|
574
|
+
<span class="method-name">insert_tail</span><span
|
575
|
+
class="method-args">(value)</span>
|
576
|
+
|
577
|
+
<span class="method-click-advice">click to toggle source</span>
|
578
|
+
|
579
|
+
</div>
|
580
|
+
|
581
|
+
|
582
|
+
<div class="method-description">
|
583
|
+
|
584
|
+
<p>Se inserta un nodo por la cola de la lista</p>
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
<div class="method-source-code" id="insert_tail-source">
|
590
|
+
<pre><span class="ruby-comment"># File lib/alimentacion/lista.rb, line 43</span>
|
591
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_tail</span>(<span class="ruby-identifier">value</span>)
|
592
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">nil?</span>
|
593
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-constant">Nodo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
594
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-ivar">@head</span>
|
595
|
+
<span class="ruby-keyword">else</span>
|
596
|
+
<span class="ruby-ivar">@tail</span>[<span class="ruby-value">:next</span>] = <span class="ruby-constant">Nodo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-ivar">@tail</span>)
|
597
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-ivar">@tail</span>[<span class="ruby-value">:next</span>]
|
598
|
+
<span class="ruby-keyword">end</span>
|
599
|
+
<span class="ruby-keyword">end</span></pre>
|
600
|
+
</div>
|
601
|
+
|
602
|
+
</div>
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
</div>
|
608
|
+
|
609
|
+
|
610
|
+
</section>
|
611
|
+
|
612
|
+
</section>
|
613
|
+
|
614
|
+
</main>
|
615
|
+
|
616
|
+
|
617
|
+
<footer id="validator-badges" role="contentinfo">
|
618
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
619
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
620
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
621
|
+
</footer>
|
622
|
+
|