linkedlist_alu0100221879 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/.gitignore +9 -0
- data/.rspec +3 -0
- data/Gemfile +4 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +9 -0
- data/Rakefile +11 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/html/Linkedlist.html +112 -0
- data/html/Linkedlist/List.html +429 -0
- data/html/Linkedlist/Menu.html +611 -0
- data/html/Linkedlist/MenuEdades.html +267 -0
- data/html/Linkedlist/MenuGrupos.html +266 -0
- data/html/Linkedlist/Node.html +206 -0
- data/html/Linkedlist/Plato.html +317 -0
- data/html/created.rid +4 -0
- data/html/css/fonts.css +167 -0
- data/html/css/rdoc.css +590 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +93 -0
- data/html/js/darkfish.js +161 -0
- data/html/js/jquery.js +4 -0
- data/html/js/navigation.js +142 -0
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +109 -0
- data/html/js/search_index.js +1 -0
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +198 -0
- data/lib/linkedlist.rb +6 -0
- data/lib/linkedlist/linkedlist.rb +302 -0
- data/lib/linkedlist/version.rb +3 -0
- data/linkedlist.gemspec +29 -0
- metadata +207 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 8762fa661244ab3021b724f2a6775e0a704ac88b
|
|
4
|
+
data.tar.gz: 3a78e8c8d316eaba20b07975d9342c574cc89a9e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 65db8147d403390901d83cdb6940b42fdadd2b1ad653d02b7b24395fcb97e2fec39089d176db752f7785c256ac61358395fa149a47ece2077e8a05aa4d7fe5b3
|
|
7
|
+
data.tar.gz: e1374b8b4dffe63096bbfb0c0808b9f43dafd28a4ffa4501ac02dac8878d6f4777017d9224dfee1f024b329eaeaad0e9f81c23e92e8332d4200680c517315abc
|
data/.gitignore
ADDED
data/.rspec
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) 2016 alu0100221879
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Lenguajes y Paradigmas de la Programación #
|
|
2
|
+
|
|
3
|
+
**Práctica 7**: Programación Orientada a Objetos
|
|
4
|
+
|
|
5
|
+
**Práctica 8**: Programación Orientada a Objetos: Herencia
|
|
6
|
+
|
|
7
|
+
**Práctica 9**: Programación Orientada a Objetos: Módulos
|
|
8
|
+
|
|
9
|
+
**Práctica 11**: Lenguajes de Dominio Específico (DSL)
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "linkedlist"
|
|
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
|
data/bin/setup
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>module Linkedlist - 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
|
+
<body id="top" role="document" class="module">
|
|
23
|
+
<nav role="navigation">
|
|
24
|
+
<div id="project-navigation">
|
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
26
|
+
<h2>
|
|
27
|
+
<a href="./index.html" rel="home">Home</a>
|
|
28
|
+
</h2>
|
|
29
|
+
|
|
30
|
+
<div id="table-of-contents-navigation">
|
|
31
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
|
32
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
|
33
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
39
|
+
<div id="search-field-wrapper">
|
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
|
47
|
+
aria-busy="false" aria-expanded="false"
|
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
49
|
+
</form>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
<div id="class-metadata">
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
</div>
|
|
63
|
+
</nav>
|
|
64
|
+
|
|
65
|
+
<main role="main" aria-labelledby="module-Linkedlist">
|
|
66
|
+
<h1 id="module-Linkedlist" class="module">
|
|
67
|
+
module Linkedlist
|
|
68
|
+
</h1>
|
|
69
|
+
|
|
70
|
+
<section class="description">
|
|
71
|
+
|
|
72
|
+
<p>Lista de menús dietéticos.</p>
|
|
73
|
+
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
<section class="constants-list">
|
|
86
|
+
<header>
|
|
87
|
+
<h3>Constants</h3>
|
|
88
|
+
</header>
|
|
89
|
+
<dl>
|
|
90
|
+
|
|
91
|
+
<dt id="VERSION">VERSION
|
|
92
|
+
|
|
93
|
+
<dd>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
</dl>
|
|
97
|
+
</section>
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
</section>
|
|
104
|
+
</main>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<footer id="validator-badges" role="contentinfo">
|
|
108
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
109
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.0.0.
|
|
110
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
111
|
+
</footer>
|
|
112
|
+
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class Linkedlist::List - 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
|
+
<body id="top" role="document" class="class">
|
|
23
|
+
<nav role="navigation">
|
|
24
|
+
<div id="project-navigation">
|
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
26
|
+
<h2>
|
|
27
|
+
<a href="../index.html" rel="home">Home</a>
|
|
28
|
+
</h2>
|
|
29
|
+
|
|
30
|
+
<div id="table-of-contents-navigation">
|
|
31
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
32
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
33
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
39
|
+
<div id="search-field-wrapper">
|
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
|
47
|
+
aria-busy="false" aria-expanded="false"
|
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
49
|
+
</form>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
<div id="class-metadata">
|
|
57
|
+
|
|
58
|
+
<div id="parent-class-section" class="nav-section">
|
|
59
|
+
<h3>Parent</h3>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
<p class="link">Object
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div id="includes-section" class="nav-section">
|
|
67
|
+
<h3>Included Modules</h3>
|
|
68
|
+
|
|
69
|
+
<ul class="link-list">
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<li><span class="include">Enumerable</span>
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
</ul>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<!-- Method Quickref -->
|
|
80
|
+
<div id="method-list-section" class="nav-section">
|
|
81
|
+
<h3>Methods</h3>
|
|
82
|
+
|
|
83
|
+
<ul class="link-list" role="directory">
|
|
84
|
+
|
|
85
|
+
<li ><a href="#method-c-new">::new</a>
|
|
86
|
+
|
|
87
|
+
<li ><a href="#method-i-each">#each</a>
|
|
88
|
+
|
|
89
|
+
<li ><a href="#method-i-empty-3F">#empty?</a>
|
|
90
|
+
|
|
91
|
+
<li ><a href="#method-i-pop">#pop</a>
|
|
92
|
+
|
|
93
|
+
<li ><a href="#method-i-push">#push</a>
|
|
94
|
+
|
|
95
|
+
<li ><a href="#method-i-push_multi">#push_multi</a>
|
|
96
|
+
|
|
97
|
+
</ul>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
</nav>
|
|
102
|
+
|
|
103
|
+
<main role="main" aria-labelledby="class-Linkedlist::List">
|
|
104
|
+
<h1 id="class-Linkedlist::List" class="class">
|
|
105
|
+
class Linkedlist::List
|
|
106
|
+
</h1>
|
|
107
|
+
|
|
108
|
+
<section class="description">
|
|
109
|
+
|
|
110
|
+
<p>Lista de menús dietéticos.</p>
|
|
111
|
+
|
|
112
|
+
</section>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<section class="attribute-method-details" class="method-section">
|
|
126
|
+
<header>
|
|
127
|
+
<h3>Attributes</h3>
|
|
128
|
+
</header>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
<div id="attribute-i-head" class="method-detail">
|
|
132
|
+
<div class="method-heading attribute-method-heading">
|
|
133
|
+
<span class="method-name">head</span><span
|
|
134
|
+
class="attribute-access-type">[R]</span>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<div class="method-description">
|
|
138
|
+
|
|
139
|
+
<p>Nodo cabeza de la lista.</p>
|
|
140
|
+
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div id="attribute-i-size" class="method-detail">
|
|
145
|
+
<div class="method-heading attribute-method-heading">
|
|
146
|
+
<span class="method-name">size</span><span
|
|
147
|
+
class="attribute-access-type">[R]</span>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<div class="method-description">
|
|
151
|
+
|
|
152
|
+
<p>Tamaño de la lista.</p>
|
|
153
|
+
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div id="attribute-i-tail" class="method-detail">
|
|
158
|
+
<div class="method-heading attribute-method-heading">
|
|
159
|
+
<span class="method-name">tail</span><span
|
|
160
|
+
class="attribute-access-type">[R]</span>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div class="method-description">
|
|
164
|
+
|
|
165
|
+
<p>Nodo cola de la lista.</p>
|
|
166
|
+
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
</section>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
175
|
+
<header>
|
|
176
|
+
<h3>Public Class Methods</h3>
|
|
177
|
+
</header>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
<div id="method-c-new" class="method-detail ">
|
|
181
|
+
|
|
182
|
+
<div class="method-heading">
|
|
183
|
+
<span class="method-name">new</span><span
|
|
184
|
+
class="method-args">()</span>
|
|
185
|
+
|
|
186
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
187
|
+
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<div class="method-description">
|
|
192
|
+
|
|
193
|
+
<p>Inicializa la lista vacía.</p>
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
<div class="method-source-code" id="new-source">
|
|
199
|
+
<pre><span class="ruby-comment"># File lib/linkedlist/linkedlist.rb, line 223</span>
|
|
200
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>()
|
|
201
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-keyword">nil</span>
|
|
202
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-keyword">nil</span>
|
|
203
|
+
<span class="ruby-ivar">@size</span> = <span class="ruby-value">0</span>
|
|
204
|
+
<span class="ruby-keyword">end</span></pre>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
</section>
|
|
216
|
+
|
|
217
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
218
|
+
<header>
|
|
219
|
+
<h3>Public Instance Methods</h3>
|
|
220
|
+
</header>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
<div id="method-i-each" class="method-detail ">
|
|
224
|
+
|
|
225
|
+
<div class="method-heading">
|
|
226
|
+
<span class="method-name">each</span><span
|
|
227
|
+
class="method-args">() { |value| ... }</span>
|
|
228
|
+
|
|
229
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
230
|
+
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
<div class="method-description">
|
|
235
|
+
|
|
236
|
+
<p>Itera la lista, ejecutando el bloque pasado pasándole como parámetro el
|
|
237
|
+
valor de cada nodo.</p>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
<div class="method-source-code" id="each-source">
|
|
243
|
+
<pre><span class="ruby-comment"># File lib/linkedlist/linkedlist.rb, line 287</span>
|
|
244
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>
|
|
245
|
+
|
|
246
|
+
<span class="ruby-identifier">nodo</span> = <span class="ruby-ivar">@head</span>
|
|
247
|
+
<span class="ruby-keyword">until</span> <span class="ruby-identifier">nodo</span>.<span class="ruby-identifier">nil?</span>
|
|
248
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">nodo</span>.<span class="ruby-identifier">value</span>
|
|
249
|
+
<span class="ruby-identifier">nodo</span> = <span class="ruby-identifier">nodo</span>.<span class="ruby-identifier">next_node</span>
|
|
250
|
+
<span class="ruby-keyword">end</span>
|
|
251
|
+
|
|
252
|
+
<span class="ruby-keyword">end</span></pre>
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
</div>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
<div id="method-i-empty-3F" class="method-detail ">
|
|
264
|
+
|
|
265
|
+
<div class="method-heading">
|
|
266
|
+
<span class="method-name">empty?</span><span
|
|
267
|
+
class="method-args">()</span>
|
|
268
|
+
|
|
269
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
270
|
+
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
<div class="method-description">
|
|
275
|
+
|
|
276
|
+
<p>Devuelve si la lista está vacía.</p>
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<div class="method-source-code" id="empty-3F-source">
|
|
282
|
+
<pre><span class="ruby-comment"># File lib/linkedlist/linkedlist.rb, line 230</span>
|
|
283
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">empty?</span>()
|
|
284
|
+
<span class="ruby-keyword">return</span> (<span class="ruby-ivar">@head</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>)
|
|
285
|
+
<span class="ruby-keyword">end</span></pre>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
<div id="method-i-pop" class="method-detail ">
|
|
297
|
+
|
|
298
|
+
<div class="method-heading">
|
|
299
|
+
<span class="method-name">pop</span><span
|
|
300
|
+
class="method-args">()</span>
|
|
301
|
+
|
|
302
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
303
|
+
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
<div class="method-description">
|
|
308
|
+
|
|
309
|
+
<p>Extrae y devuelve el menú del principio de la lista.</p>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
<div class="method-source-code" id="pop-source">
|
|
315
|
+
<pre><span class="ruby-comment"># File lib/linkedlist/linkedlist.rb, line 267</span>
|
|
316
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pop</span>()
|
|
317
|
+
|
|
318
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-string">"[List.pop]: No se puede extraer elementos de una lista vacía"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">empty?</span>()
|
|
319
|
+
|
|
320
|
+
<span class="ruby-identifier">nodo</span> = <span class="ruby-ivar">@head</span>
|
|
321
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">equal?</span>(<span class="ruby-ivar">@tail</span>)
|
|
322
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-keyword">nil</span>
|
|
323
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-keyword">nil</span>
|
|
324
|
+
<span class="ruby-keyword">else</span>
|
|
325
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">next_node</span>
|
|
326
|
+
<span class="ruby-ivar">@head</span>.<span class="ruby-identifier">prev_node</span> = <span class="ruby-keyword">nil</span>
|
|
327
|
+
<span class="ruby-keyword">end</span>
|
|
328
|
+
|
|
329
|
+
<span class="ruby-ivar">@size</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
|
330
|
+
|
|
331
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">nodo</span>.<span class="ruby-identifier">value</span>
|
|
332
|
+
|
|
333
|
+
<span class="ruby-keyword">end</span></pre>
|
|
334
|
+
</div>
|
|
335
|
+
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
<div id="method-i-push" class="method-detail ">
|
|
345
|
+
|
|
346
|
+
<div class="method-heading">
|
|
347
|
+
<span class="method-name">push</span><span
|
|
348
|
+
class="method-args">(ref)</span>
|
|
349
|
+
|
|
350
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
351
|
+
|
|
352
|
+
</div>
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
<div class="method-description">
|
|
356
|
+
|
|
357
|
+
<p>Inserta el menú <em>ref</em> al final de la lista.</p>
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
<div class="method-source-code" id="push-source">
|
|
363
|
+
<pre><span class="ruby-comment"># File lib/linkedlist/linkedlist.rb, line 249</span>
|
|
364
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">push</span>(<span class="ruby-identifier">ref</span>)
|
|
365
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">empty?</span>()
|
|
366
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">push_empty</span>(<span class="ruby-identifier">ref</span>)
|
|
367
|
+
<span class="ruby-keyword">else</span>
|
|
368
|
+
<span class="ruby-identifier">nodo</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ref</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-ivar">@tail</span>)
|
|
369
|
+
<span class="ruby-ivar">@tail</span>.<span class="ruby-identifier">next_node</span> = <span class="ruby-identifier">nodo</span>
|
|
370
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-identifier">nodo</span>
|
|
371
|
+
<span class="ruby-ivar">@size</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
372
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>
|
|
373
|
+
<span class="ruby-keyword">end</span>
|
|
374
|
+
<span class="ruby-keyword">end</span></pre>
|
|
375
|
+
</div>
|
|
376
|
+
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
<div id="method-i-push_multi" class="method-detail ">
|
|
386
|
+
|
|
387
|
+
<div class="method-heading">
|
|
388
|
+
<span class="method-name">push_multi</span><span
|
|
389
|
+
class="method-args">(*refs)</span>
|
|
390
|
+
|
|
391
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
392
|
+
|
|
393
|
+
</div>
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
<div class="method-description">
|
|
397
|
+
|
|
398
|
+
<p>Inserta múltiples elementos al final de la lista.</p>
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
<div class="method-source-code" id="push_multi-source">
|
|
404
|
+
<pre><span class="ruby-comment"># File lib/linkedlist/linkedlist.rb, line 262</span>
|
|
405
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">push_multi</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">refs</span>)
|
|
406
|
+
<span class="ruby-identifier">refs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ref</span><span class="ruby-operator">|</span> <span class="ruby-identifier">push</span>(<span class="ruby-identifier">ref</span>)}
|
|
407
|
+
<span class="ruby-keyword">end</span></pre>
|
|
408
|
+
</div>
|
|
409
|
+
|
|
410
|
+
</div>
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
</div>
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
</section>
|
|
419
|
+
|
|
420
|
+
</section>
|
|
421
|
+
</main>
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
<footer id="validator-badges" role="contentinfo">
|
|
425
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
426
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.0.0.
|
|
427
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
428
|
+
</footer>
|
|
429
|
+
|