pract11 0.1.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.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +5 -0
- data/Rakefile +8 -0
- data/alimento.gemspec +47 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Lista.html +709 -0
- data/docs/Node.html +398 -0
- data/docs/Pr06.html +117 -0
- data/docs/_index.html +133 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +492 -0
- data/docs/file.README.html +74 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +74 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +139 -0
- data/docs/top-level-namespace.html +112 -0
- data/lib/pr06.rb +6 -0
- data/lib/pr06/alimento.rb +166 -0
- data/lib/pr06/lista_d.rb +101 -0
- data/lib/pr06/plato.rb +158 -0
- data/lib/pr06/version.rb +3 -0
- metadata +177 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 89616917eca47f58071a7153f18a46adfc33f9ee
|
|
4
|
+
data.tar.gz: 643909c8d7d0b397e11edb134040b7f4d1ccd8b8
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ec71e034b7355e5fa847cd874f405ae41cf33de91b97fe3498ce03b764aa02b86387c6d04d3b5f300afc9e987c087b9376d096150ba5bedd4916c33b75441ce0
|
|
7
|
+
data.tar.gz: 731361199129d7aae7eb061e891fed712f98d34ec9b73c799529bede047ea1f6f908501f5bbdaf3112c7f2b285db8fe64426fe56ceea9d8052356b8b6bb80be0
|
data/.coveralls.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# A sample Guardfile
|
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
|
3
|
+
|
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
|
5
|
+
# directories %w(app lib config test spec features) \
|
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
|
7
|
+
|
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
|
11
|
+
#
|
|
12
|
+
# $ mkdir config
|
|
13
|
+
# $ mv Guardfile config/
|
|
14
|
+
# $ ln -s config/Guardfile .
|
|
15
|
+
#
|
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
|
17
|
+
|
|
18
|
+
guard :bundler do
|
|
19
|
+
require 'guard/bundler'
|
|
20
|
+
require 'guard/bundler/verify'
|
|
21
|
+
helper = Guard::Bundler::Verify.new
|
|
22
|
+
|
|
23
|
+
files = ['Gemfile']
|
|
24
|
+
files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
|
|
25
|
+
|
|
26
|
+
# Assume files are symlinked from somewhere
|
|
27
|
+
files.each { |file| watch(helper.real_path(file)) }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
|
31
|
+
# rspec may be run, below are examples of the most common uses.
|
|
32
|
+
# * bundler: 'bundle exec rspec'
|
|
33
|
+
# * bundler binstubs: 'bin/rspec'
|
|
34
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
|
35
|
+
# installed the spring binstubs per the docs)
|
|
36
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
|
37
|
+
# * 'just' rspec: 'rspec'
|
|
38
|
+
|
|
39
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
|
40
|
+
require "guard/rspec/dsl"
|
|
41
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
|
42
|
+
|
|
43
|
+
# Feel free to open issues for suggestions and improvements
|
|
44
|
+
|
|
45
|
+
# RSpec files
|
|
46
|
+
rspec = dsl.rspec
|
|
47
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
|
48
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
|
49
|
+
watch(rspec.spec_files)
|
|
50
|
+
|
|
51
|
+
# Ruby files
|
|
52
|
+
ruby = dsl.ruby
|
|
53
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
|
54
|
+
|
|
55
|
+
# Rails files
|
|
56
|
+
rails = dsl.rails(view_extensions: %w(erb haml slim))
|
|
57
|
+
dsl.watch_spec_files_for(rails.app_files)
|
|
58
|
+
dsl.watch_spec_files_for(rails.views)
|
|
59
|
+
|
|
60
|
+
watch(rails.controllers) do |m|
|
|
61
|
+
[
|
|
62
|
+
rspec.spec.call("routing/#{m[1]}_routing"),
|
|
63
|
+
rspec.spec.call("controllers/#{m[1]}_controller"),
|
|
64
|
+
rspec.spec.call("acceptance/#{m[1]}")
|
|
65
|
+
]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Rails config changes
|
|
69
|
+
watch(rails.spec_helper) { rspec.spec_dir }
|
|
70
|
+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
|
71
|
+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
|
72
|
+
|
|
73
|
+
# Capybara features specs
|
|
74
|
+
watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
|
|
75
|
+
watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
|
|
76
|
+
|
|
77
|
+
# Turnip features and steps
|
|
78
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
|
79
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
|
80
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
|
81
|
+
end
|
|
82
|
+
end
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Marco Antonio Maestre Mirabal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
data/alimento.gemspec
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require "pr06/version"
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "pract11"
|
|
7
|
+
spec.version = Pr06::VERSION
|
|
8
|
+
spec.authors = ["Marco Antonio Maestre Mirabal"]
|
|
9
|
+
spec.email = ["alu0100890709@ull.edu.es"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{Write a short summary, because Rubygems requires one.}
|
|
13
|
+
spec.description = %q{ Write a longer description or delete this line.}
|
|
14
|
+
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
|
15
|
+
|
|
16
|
+
spec.summary = %q{Práctica de Laboratorio #6. Desarrollo Dirigido por Pruebas (TDD)..}
|
|
17
|
+
spec.description = %q{Practica sobre el Desarrollo Dirigido por Pruebas para la clase Alimento.}
|
|
18
|
+
spec.homepage = "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100890709"
|
|
19
|
+
|
|
20
|
+
spec.license = "MIT"
|
|
21
|
+
|
|
22
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
23
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
24
|
+
if spec.respond_to?(:metadata)
|
|
25
|
+
spec.metadata["allowed_push_host"] = 'https://rubygems.org'
|
|
26
|
+
else
|
|
27
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
|
28
|
+
"public gem pushes."
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
32
|
+
f.match(%r{^(test|spec|features)/})
|
|
33
|
+
end
|
|
34
|
+
spec.bindir = "exe"
|
|
35
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
36
|
+
spec.require_paths = ["lib"]
|
|
37
|
+
|
|
38
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
|
39
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
40
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
41
|
+
|
|
42
|
+
spec.add_development_dependency "guard"
|
|
43
|
+
spec.add_development_dependency "guard-rspec"
|
|
44
|
+
spec.add_development_dependency "guard-bundler"
|
|
45
|
+
|
|
46
|
+
spec.add_development_dependency "coveralls"
|
|
47
|
+
end
|
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "pr06"
|
|
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
data/docs/Lista.html
ADDED
|
@@ -0,0 +1,709 @@
|
|
|
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: Lista
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.9
|
|
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 = "Lista";
|
|
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 (L)</a> »
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<span class="title">Lista</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: Lista
|
|
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">Lista</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>Enumerable</dd>
|
|
93
|
+
</dl>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<dl>
|
|
101
|
+
<dt>Defined in:</dt>
|
|
102
|
+
<dd>lib/pr06/lista_d.rb</dd>
|
|
103
|
+
</dl>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
112
|
+
<ul class="summary">
|
|
113
|
+
|
|
114
|
+
<li class="public ">
|
|
115
|
+
<span class="summary_signature">
|
|
116
|
+
|
|
117
|
+
<a href="#head-instance_method" title="#head (instance method)">#<strong>head</strong> ⇒ Object </a>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</span>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
<span class="note title readonly">readonly</span>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
<span class="summary_desc"><div class='inline'>
|
|
137
|
+
<p>Returns the value of attribute head.</p>
|
|
138
|
+
</div></span>
|
|
139
|
+
|
|
140
|
+
</li>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<li class="public ">
|
|
144
|
+
<span class="summary_signature">
|
|
145
|
+
|
|
146
|
+
<a href="#tail-instance_method" title="#tail (instance method)">#<strong>tail</strong> ⇒ Object </a>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
</span>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
<span class="note title readonly">readonly</span>
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
<span class="summary_desc"><div class='inline'>
|
|
166
|
+
<p>Returns the value of attribute tail.</p>
|
|
167
|
+
</div></span>
|
|
168
|
+
|
|
169
|
+
</li>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
</ul>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<h2>
|
|
179
|
+
Instance Method Summary
|
|
180
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
181
|
+
</h2>
|
|
182
|
+
|
|
183
|
+
<ul class="summary">
|
|
184
|
+
|
|
185
|
+
<li class="public ">
|
|
186
|
+
<span class="summary_signature">
|
|
187
|
+
|
|
188
|
+
<a href="#each-instance_method" title="#each (instance method)">#<strong>each</strong> {|@head| ... } ⇒ Object </a>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
</span>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
203
|
+
|
|
204
|
+
</li>
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
<li class="public ">
|
|
208
|
+
<span class="summary_signature">
|
|
209
|
+
|
|
210
|
+
<a href="#extract_head-instance_method" title="#extract_head (instance method)">#<strong>extract_head</strong> ⇒ Object </a>
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
</span>
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
225
|
+
|
|
226
|
+
</li>
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
<li class="public ">
|
|
230
|
+
<span class="summary_signature">
|
|
231
|
+
|
|
232
|
+
<a href="#extract_tail-instance_method" title="#extract_tail (instance method)">#<strong>extract_tail</strong> ⇒ Object </a>
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
</span>
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
247
|
+
|
|
248
|
+
</li>
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
<li class="public ">
|
|
252
|
+
<span class="summary_signature">
|
|
253
|
+
|
|
254
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Lista </a>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
</span>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
<span class="note title constructor">constructor</span>
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
<span class="summary_desc"><div class='inline'>
|
|
271
|
+
<p>A new instance of Lista.</p>
|
|
272
|
+
</div></span>
|
|
273
|
+
|
|
274
|
+
</li>
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
<li class="public ">
|
|
278
|
+
<span class="summary_signature">
|
|
279
|
+
|
|
280
|
+
<a href="#insert-instance_method" title="#insert (instance method)">#<strong>insert</strong>(value) ⇒ Object </a>
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
</span>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
295
|
+
|
|
296
|
+
</li>
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
<li class="public ">
|
|
300
|
+
<span class="summary_signature">
|
|
301
|
+
|
|
302
|
+
<a href="#insert_many-instance_method" title="#insert_many (instance method)">#<strong>insert_many</strong>(v1, v2, v3) ⇒ Object </a>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
</span>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
317
|
+
|
|
318
|
+
</li>
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
</ul>
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<div id="constructor_details" class="method_details_list">
|
|
326
|
+
<h2>Constructor Details</h2>
|
|
327
|
+
|
|
328
|
+
<div class="method_details first">
|
|
329
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
330
|
+
|
|
331
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Lista (class)">Lista</a></span></tt>
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
</h3><div class="docstring">
|
|
338
|
+
<div class="discussion">
|
|
339
|
+
|
|
340
|
+
<p>Returns a new instance of Lista</p>
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
<div class="tags">
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
</div><table class="source_code">
|
|
349
|
+
<tr>
|
|
350
|
+
<td>
|
|
351
|
+
<pre class="lines">
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
12
|
|
355
|
+
13
|
|
356
|
+
14
|
|
357
|
+
15</pre>
|
|
358
|
+
</td>
|
|
359
|
+
<td>
|
|
360
|
+
<pre class="code"><span class="info file"># File 'lib/pr06/lista_d.rb', line 12</span>
|
|
361
|
+
|
|
362
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
|
363
|
+
<span class='ivar'>@head</span><span class='op'>=</span><span class='kw'>nil</span>
|
|
364
|
+
<span class='ivar'>@tail</span><span class='op'>=</span><span class='kw'>nil</span>
|
|
365
|
+
<span class='kw'>end</span></pre>
|
|
366
|
+
</td>
|
|
367
|
+
</tr>
|
|
368
|
+
</table>
|
|
369
|
+
</div>
|
|
370
|
+
|
|
371
|
+
</div>
|
|
372
|
+
|
|
373
|
+
<div id="instance_attr_details" class="attr_details">
|
|
374
|
+
<h2>Instance Attribute Details</h2>
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
<span id=""></span>
|
|
378
|
+
<div class="method_details first">
|
|
379
|
+
<h3 class="signature first" id="head-instance_method">
|
|
380
|
+
|
|
381
|
+
#<strong>head</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
</h3><div class="docstring">
|
|
388
|
+
<div class="discussion">
|
|
389
|
+
|
|
390
|
+
<p>Returns the value of attribute head</p>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
</div>
|
|
394
|
+
</div>
|
|
395
|
+
<div class="tags">
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
</div><table class="source_code">
|
|
399
|
+
<tr>
|
|
400
|
+
<td>
|
|
401
|
+
<pre class="lines">
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
11
|
|
405
|
+
12
|
|
406
|
+
13</pre>
|
|
407
|
+
</td>
|
|
408
|
+
<td>
|
|
409
|
+
<pre class="code"><span class="info file"># File 'lib/pr06/lista_d.rb', line 11</span>
|
|
410
|
+
|
|
411
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_head'>head</span>
|
|
412
|
+
<span class='ivar'>@head</span>
|
|
413
|
+
<span class='kw'>end</span></pre>
|
|
414
|
+
</td>
|
|
415
|
+
</tr>
|
|
416
|
+
</table>
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
<span id=""></span>
|
|
421
|
+
<div class="method_details ">
|
|
422
|
+
<h3 class="signature " id="tail-instance_method">
|
|
423
|
+
|
|
424
|
+
#<strong>tail</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
</h3><div class="docstring">
|
|
431
|
+
<div class="discussion">
|
|
432
|
+
|
|
433
|
+
<p>Returns the value of attribute tail</p>
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
</div>
|
|
437
|
+
</div>
|
|
438
|
+
<div class="tags">
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
</div><table class="source_code">
|
|
442
|
+
<tr>
|
|
443
|
+
<td>
|
|
444
|
+
<pre class="lines">
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
11
|
|
448
|
+
12
|
|
449
|
+
13</pre>
|
|
450
|
+
</td>
|
|
451
|
+
<td>
|
|
452
|
+
<pre class="code"><span class="info file"># File 'lib/pr06/lista_d.rb', line 11</span>
|
|
453
|
+
|
|
454
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_tail'>tail</span>
|
|
455
|
+
<span class='ivar'>@tail</span>
|
|
456
|
+
<span class='kw'>end</span></pre>
|
|
457
|
+
</td>
|
|
458
|
+
</tr>
|
|
459
|
+
</table>
|
|
460
|
+
</div>
|
|
461
|
+
|
|
462
|
+
</div>
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
<div id="instance_method_details" class="method_details_list">
|
|
466
|
+
<h2>Instance Method Details</h2>
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
<div class="method_details first">
|
|
470
|
+
<h3 class="signature first" id="each-instance_method">
|
|
471
|
+
|
|
472
|
+
#<strong>each</strong> {|@head| ... } ⇒ <tt>Object</tt>
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
</h3><div class="docstring">
|
|
479
|
+
<div class="discussion">
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
<div class="tags">
|
|
485
|
+
|
|
486
|
+
<p class="tag_title">Yields:</p>
|
|
487
|
+
<ul class="yield">
|
|
488
|
+
|
|
489
|
+
<li>
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
<span class='type'>(<tt>@<span class='object_link'><a href="#head-instance_method" title="Lista#head (method)">head</a></span></tt>)</span>
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
</li>
|
|
497
|
+
|
|
498
|
+
</ul>
|
|
499
|
+
|
|
500
|
+
</div><table class="source_code">
|
|
501
|
+
<tr>
|
|
502
|
+
<td>
|
|
503
|
+
<pre class="lines">
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
59
|
|
507
|
+
60
|
|
508
|
+
61
|
|
509
|
+
62
|
|
510
|
+
63
|
|
511
|
+
64</pre>
|
|
512
|
+
</td>
|
|
513
|
+
<td>
|
|
514
|
+
<pre class="code"><span class="info file"># File 'lib/pr06/lista_d.rb', line 59</span>
|
|
515
|
+
|
|
516
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span>
|
|
517
|
+
|
|
518
|
+
<span class='kw'>yield</span> <span class='ivar'>@head</span>
|
|
519
|
+
<span class='kw'>yield</span> <span class='ivar'>@tail</span>
|
|
520
|
+
|
|
521
|
+
<span class='kw'>end</span></pre>
|
|
522
|
+
</td>
|
|
523
|
+
</tr>
|
|
524
|
+
</table>
|
|
525
|
+
</div>
|
|
526
|
+
|
|
527
|
+
<div class="method_details ">
|
|
528
|
+
<h3 class="signature " id="extract_head-instance_method">
|
|
529
|
+
|
|
530
|
+
#<strong>extract_head</strong> ⇒ <tt>Object</tt>
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
</h3><table class="source_code">
|
|
537
|
+
<tr>
|
|
538
|
+
<td>
|
|
539
|
+
<pre class="lines">
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
44
|
|
543
|
+
45
|
|
544
|
+
46
|
|
545
|
+
47
|
|
546
|
+
48
|
|
547
|
+
49
|
|
548
|
+
50</pre>
|
|
549
|
+
</td>
|
|
550
|
+
<td>
|
|
551
|
+
<pre class="code"><span class="info file"># File 'lib/pr06/lista_d.rb', line 44</span>
|
|
552
|
+
|
|
553
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_head'>extract_head</span>
|
|
554
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_head'>head</span> <span class='op'>==</span><span class='kw'>nil</span>
|
|
555
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No hay nada que extraer</span><span class='tstring_end'>"</span></span>
|
|
556
|
+
<span class='kw'>else</span>
|
|
557
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span> <span class='id identifier rubyid_head'>head</span>
|
|
558
|
+
<span class='kw'>end</span>
|
|
559
|
+
<span class='kw'>end</span></pre>
|
|
560
|
+
</td>
|
|
561
|
+
</tr>
|
|
562
|
+
</table>
|
|
563
|
+
</div>
|
|
564
|
+
|
|
565
|
+
<div class="method_details ">
|
|
566
|
+
<h3 class="signature " id="extract_tail-instance_method">
|
|
567
|
+
|
|
568
|
+
#<strong>extract_tail</strong> ⇒ <tt>Object</tt>
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
</h3><table class="source_code">
|
|
575
|
+
<tr>
|
|
576
|
+
<td>
|
|
577
|
+
<pre class="lines">
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
52
|
|
581
|
+
53
|
|
582
|
+
54
|
|
583
|
+
55
|
|
584
|
+
56
|
|
585
|
+
57
|
|
586
|
+
58</pre>
|
|
587
|
+
</td>
|
|
588
|
+
<td>
|
|
589
|
+
<pre class="code"><span class="info file"># File 'lib/pr06/lista_d.rb', line 52</span>
|
|
590
|
+
|
|
591
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_tail'>extract_tail</span>
|
|
592
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_head'>head</span> <span class='op'>==</span><span class='kw'>nil</span>
|
|
593
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No hay nada que extraer</span><span class='tstring_end'>"</span></span>
|
|
594
|
+
<span class='kw'>else</span>
|
|
595
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span> <span class='id identifier rubyid_tail'>tail</span>
|
|
596
|
+
<span class='kw'>end</span>
|
|
597
|
+
<span class='kw'>end</span></pre>
|
|
598
|
+
</td>
|
|
599
|
+
</tr>
|
|
600
|
+
</table>
|
|
601
|
+
</div>
|
|
602
|
+
|
|
603
|
+
<div class="method_details ">
|
|
604
|
+
<h3 class="signature " id="insert-instance_method">
|
|
605
|
+
|
|
606
|
+
#<strong>insert</strong>(value) ⇒ <tt>Object</tt>
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
</h3><table class="source_code">
|
|
613
|
+
<tr>
|
|
614
|
+
<td>
|
|
615
|
+
<pre class="lines">
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
18
|
|
619
|
+
19
|
|
620
|
+
20
|
|
621
|
+
21
|
|
622
|
+
22
|
|
623
|
+
23
|
|
624
|
+
24
|
|
625
|
+
25</pre>
|
|
626
|
+
</td>
|
|
627
|
+
<td>
|
|
628
|
+
<pre class="code"><span class="info file"># File 'lib/pr06/lista_d.rb', line 18</span>
|
|
629
|
+
|
|
630
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
631
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_head'>head</span> <span class='op'>==</span><span class='kw'>nil</span>
|
|
632
|
+
<span class='id identifier rubyid_head'>head</span><span class='period'>.</span><span class='const'>Node</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span><span class='kw'>nil</span><span class='comma'>,</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
|
633
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_head'>head</span>
|
|
634
|
+
<span class='kw'>else</span>
|
|
635
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_value'>value</span>
|
|
636
|
+
<span class='kw'>end</span>
|
|
637
|
+
<span class='kw'>end</span></pre>
|
|
638
|
+
</td>
|
|
639
|
+
</tr>
|
|
640
|
+
</table>
|
|
641
|
+
</div>
|
|
642
|
+
|
|
643
|
+
<div class="method_details ">
|
|
644
|
+
<h3 class="signature " id="insert_many-instance_method">
|
|
645
|
+
|
|
646
|
+
#<strong>insert_many</strong>(v1, v2, v3) ⇒ <tt>Object</tt>
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
</h3><table class="source_code">
|
|
653
|
+
<tr>
|
|
654
|
+
<td>
|
|
655
|
+
<pre class="lines">
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
27
|
|
659
|
+
28
|
|
660
|
+
29
|
|
661
|
+
30
|
|
662
|
+
31
|
|
663
|
+
32
|
|
664
|
+
33
|
|
665
|
+
34
|
|
666
|
+
35
|
|
667
|
+
36
|
|
668
|
+
37
|
|
669
|
+
38
|
|
670
|
+
39
|
|
671
|
+
40
|
|
672
|
+
41</pre>
|
|
673
|
+
</td>
|
|
674
|
+
<td>
|
|
675
|
+
<pre class="code"><span class="info file"># File 'lib/pr06/lista_d.rb', line 27</span>
|
|
676
|
+
|
|
677
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_insert_many'>insert_many</span><span class='lparen'>(</span><span class='id identifier rubyid_v1'>v1</span><span class='comma'>,</span><span class='id identifier rubyid_v2'>v2</span><span class='comma'>,</span><span class='id identifier rubyid_v3'>v3</span><span class='rparen'>)</span>
|
|
678
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_head'>head</span> <span class='op'>==</span><span class='kw'>nil</span>
|
|
679
|
+
<span class='id identifier rubyid_head'>head</span><span class='period'>.</span><span class='const'>Node</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_v1'>v1</span><span class='comma'>,</span><span class='kw'>nil</span><span class='comma'>,</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
|
680
|
+
<span class='ivar'>@n1</span><span class='period'>.</span><span class='const'><span class='object_link'><a href="Node.html" title="Node (class)">Node</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_v2'>v2</span><span class='comma'>,</span><span class='kw'>nil</span><span class='comma'>,</span><span class='id identifier rubyid_head'>head</span><span class='rparen'>)</span>
|
|
681
|
+
<span class='ivar'>@n2</span><span class='period'>.</span><span class='const'><span class='object_link'><a href="Node.html" title="Node (class)">Node</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_v3'>v3</span><span class='comma'>,</span><span class='kw'>nil</span><span class='comma'>,</span><span class='ivar'>@n1</span><span class='rparen'>)</span>
|
|
682
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_head'>head</span>
|
|
683
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='ivar'>@n1</span>
|
|
684
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='ivar'>@n2</span>
|
|
685
|
+
|
|
686
|
+
<span class='kw'>else</span>
|
|
687
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_v1'>v1</span>
|
|
688
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_v2'>v2</span>
|
|
689
|
+
<span class='id identifier rubyid_lista'>lista</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_v3'>v3</span>
|
|
690
|
+
<span class='kw'>end</span>
|
|
691
|
+
<span class='kw'>end</span></pre>
|
|
692
|
+
</td>
|
|
693
|
+
</tr>
|
|
694
|
+
</table>
|
|
695
|
+
</div>
|
|
696
|
+
|
|
697
|
+
</div>
|
|
698
|
+
|
|
699
|
+
</div>
|
|
700
|
+
|
|
701
|
+
<div id="footer">
|
|
702
|
+
Generated on Wed Nov 15 12:03:09 2017 by
|
|
703
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
704
|
+
0.9.9 (ruby-2.3.0).
|
|
705
|
+
</div>
|
|
706
|
+
|
|
707
|
+
</div>
|
|
708
|
+
</body>
|
|
709
|
+
</html>
|