prct11 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +8 -0
  4. data/.travis.yml +6 -0
  5. data/CODE_OF_CONDUCT.md +13 -0
  6. data/Gemfile +5 -0
  7. data/Guardfile +88 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +53 -0
  10. data/Rakefile +5 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +7 -0
  13. data/doc/APA.html +377 -0
  14. data/doc/Book.html +296 -0
  15. data/doc/CODE_OF_CONDUCT_md.html +125 -0
  16. data/doc/DSL.html +153 -0
  17. data/doc/DSLBook.html +278 -0
  18. data/doc/DSLJournal.html +281 -0
  19. data/doc/Electronicdocument.html +211 -0
  20. data/doc/Gemfile.html +99 -0
  21. data/doc/Gemfile_lock.html +221 -0
  22. data/doc/Guardfile.html +186 -0
  23. data/doc/JournalArticle.html +301 -0
  24. data/doc/LICENSE_txt.html +117 -0
  25. data/doc/LinkedList.html +588 -0
  26. data/doc/MagazineArticle.html +301 -0
  27. data/doc/Object.html +126 -0
  28. data/doc/Prct11.html +109 -0
  29. data/doc/README_md.html +164 -0
  30. data/doc/Rakefile.html +99 -0
  31. data/doc/Reference.html +303 -0
  32. data/doc/Regularpublications.html +158 -0
  33. data/doc/bin/setup.html +101 -0
  34. data/doc/created.rid +35 -0
  35. data/doc/css/fonts.css +167 -0
  36. data/doc/css/rdoc.css +590 -0
  37. data/doc/fonts/Lato-Light.ttf +0 -0
  38. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  39. data/doc/fonts/Lato-Regular.ttf +0 -0
  40. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  41. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  42. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  43. data/doc/images/add.png +0 -0
  44. data/doc/images/arrow_up.png +0 -0
  45. data/doc/images/brick.png +0 -0
  46. data/doc/images/brick_link.png +0 -0
  47. data/doc/images/bug.png +0 -0
  48. data/doc/images/bullet_black.png +0 -0
  49. data/doc/images/bullet_toggle_minus.png +0 -0
  50. data/doc/images/bullet_toggle_plus.png +0 -0
  51. data/doc/images/date.png +0 -0
  52. data/doc/images/delete.png +0 -0
  53. data/doc/images/find.png +0 -0
  54. data/doc/images/loadingAnimation.gif +0 -0
  55. data/doc/images/macFFBgHack.png +0 -0
  56. data/doc/images/package.png +0 -0
  57. data/doc/images/page_green.png +0 -0
  58. data/doc/images/page_white_text.png +0 -0
  59. data/doc/images/page_white_width.png +0 -0
  60. data/doc/images/plugin.png +0 -0
  61. data/doc/images/ruby.png +0 -0
  62. data/doc/images/tag_blue.png +0 -0
  63. data/doc/images/tag_green.png +0 -0
  64. data/doc/images/transparent.png +0 -0
  65. data/doc/images/wrench.png +0 -0
  66. data/doc/images/wrench_orange.png +0 -0
  67. data/doc/images/zoom.png +0 -0
  68. data/doc/index.html +129 -0
  69. data/doc/js/darkfish.js +161 -0
  70. data/doc/js/jquery.js +4 -0
  71. data/doc/js/navigation.js +142 -0
  72. data/doc/js/navigation.js.gz +0 -0
  73. data/doc/js/search.js +109 -0
  74. data/doc/js/search_index.js +1 -0
  75. data/doc/js/search_index.js.gz +0 -0
  76. data/doc/js/searcher.js +228 -0
  77. data/doc/js/searcher.js.gz +0 -0
  78. data/doc/prct11_gemspec.html +136 -0
  79. data/doc/table_of_contents.html +301 -0
  80. data/lib/prct11.rb +13 -0
  81. data/lib/prct11/APA.rb +153 -0
  82. data/lib/prct11/DSL.rb +78 -0
  83. data/lib/prct11/book.rb +37 -0
  84. data/lib/prct11/electronicdocument.rb +20 -0
  85. data/lib/prct11/journalarticle.rb +42 -0
  86. data/lib/prct11/linkedList.rb +96 -0
  87. data/lib/prct11/magazinearticle.rb +42 -0
  88. data/lib/prct11/prueba.rb +42 -0
  89. data/lib/prct11/reference.rb +33 -0
  90. data/lib/prct11/regularpublications.rb +6 -0
  91. data/lib/prct11/version.rb +3 -0
  92. data/prct11.gemspec +40 -0
  93. metadata +263 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 542b9363e6fb767c799bd287629ffc43ec7921c5
4
+ data.tar.gz: e89f1f5a1cd684ff93b4b71d0bf335000153b0a1
5
+ SHA512:
6
+ metadata.gz: 6d3b3f4d4569a10ff96758d4b59ce9e658bd4b09b5c0ef742d68301f223f75d52c03ac65f7738ac1ee496be9ce171767e469419de669d657a3dec89f0420de20
7
+ data.tar.gz: 53062373d55aa14fb8bef8c73d46078f7edb76ceb8ff5411d8ec579ee29cdaba5fd29f50f9370cb305b64601f3dbe46c32c878d83c6d3ede1d815f97385eba63
@@ -0,0 +1 @@
1
+ service_name: travis-ci
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ - 2.2.0
5
+
6
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in prct10.gemspec
4
+ gemspec
5
+
@@ -0,0 +1,88 @@
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
+ #ficheros introducidos por mi
52
+ watch(%r{^spec/.+_spec\.rb$})
53
+ watch(%r{^lib/prct10/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
54
+ watch('spec/spec_helper.rb') { "spec" }
55
+ #fin de fichero introdicidos por mi
56
+
57
+ # Ruby files
58
+ ruby = dsl.ruby
59
+ dsl.watch_spec_files_for(ruby.lib_files)
60
+
61
+ # Rails files
62
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
63
+ dsl.watch_spec_files_for(rails.app_files)
64
+ dsl.watch_spec_files_for(rails.views)
65
+
66
+ watch(rails.controllers) do |m|
67
+ [
68
+ rspec.spec.("routing/#{m[1]}_routing"),
69
+ rspec.spec.("controllers/#{m[1]}_controller"),
70
+ rspec.spec.("acceptance/#{m[1]}")
71
+ ]
72
+ end
73
+
74
+ # Rails config changes
75
+ watch(rails.spec_helper) { rspec.spec_dir }
76
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
77
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
78
+
79
+ # Capybara features specs
80
+ watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
81
+ watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
82
+
83
+ # Turnip features and steps
84
+ watch(%r{^spec/acceptance/(.+)\.feature$})
85
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
86
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
87
+ end
88
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Germán Méndez
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.
@@ -0,0 +1,53 @@
1
+ [![Build Status](https://travis-ci.org/gcpmendez/prct10.svg?branch=master)](https://travis-ci.org/gcpmendez/prct10)
2
+ [![Coverage Status](https://coveralls.io/repos/gcpmendez/prct10/badge.svg?branch=master&service=github)](https://coveralls.io/github/gcpmendez/prct10?branch=master)
3
+
4
+ # Práctica de laboratorio \#10
5
+
6
+ Este práctica ha sido desarrollado en la asignatura de **Lenguajes y Paradigmas de la Programación** del **_Grado en Ingeniería Informática_** de la **ULL**.
7
+
8
+ ## Descripción de la práctica: Programación funcional
9
+
10
+
11
+ [Enunciado de la práctica](https://github.com/gcpmendez/prct10/blob/master/prct10.pdf "statement")
12
+
13
+ ## Árbol de ficheros y directorios
14
+ ```
15
+ .
16
+ ├── CODE_OF_CONDUCT.md
17
+ ├── Gemfile
18
+ ├── Gemfile.lock
19
+ ├── Guardfile
20
+ ├── LICENSE.txt
21
+ ├── README.md
22
+ ├── Rakefile
23
+ ├── bin
24
+ │   ├── console
25
+ │   └── setup
26
+ ├── coverage
27
+ ├── lib
28
+ │   ├── prct10
29
+ │   │   ├── APA.rb
30
+ │   │   ├── book.rb
31
+ │   │   ├── electronicdocument.rb
32
+ │   │   ├── journalarticle.rb
33
+ │   │   ├── linkedList.rb
34
+ │   │   ├── magazinearticle.rb
35
+ │   │   ├── reference.rb
36
+ │   │   ├── regularpublications.rb
37
+ │   │   └── version.rb
38
+ │   └── prct10.rb
39
+ ├── prct10.gemspec
40
+ ├── prct10.pdf
41
+ ├── spec
42
+ │   ├── APA_spec.rb
43
+ │   ├── Comparable_spec.rb
44
+ │   ├── Enumerable_spec.rb
45
+ │   ├── book_spec.rb
46
+ │   ├── electronicdocument_spec.rb
47
+ │   ├── journalarticle_spec.rb
48
+ │   ├── linkedlist_spec.rb
49
+ │   ├── magazinearticle_spec.rb
50
+ │   ├── reference_spec.rb
51
+ │   ├── regularpublications_spec.rb
52
+ │   └── spec_helper.rb
53
+ └── tmp```
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new
5
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "lpp_Grupo3"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,377 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class APA - RDoc Documentation</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ </script>
12
+
13
+ <script src="./js/jquery.js"></script>
14
+ <script src="./js/darkfish.js"></script>
15
+
16
+ <link href="./css/fonts.css" rel="stylesheet">
17
+ <link href="./css/rdoc.css" rel="stylesheet">
18
+
19
+
20
+
21
+ <body id="top" role="document" class="class">
22
+ <nav role="navigation">
23
+ <div id="project-navigation">
24
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
+ <h2>
26
+ <a href="./index.html" rel="home">Home</a>
27
+ </h2>
28
+
29
+ <div id="table-of-contents-navigation">
30
+ <a href="./table_of_contents.html#pages">Pages</a>
31
+ <a href="./table_of_contents.html#classes">Classes</a>
32
+ <a href="./table_of_contents.html#methods">Methods</a>
33
+ </div>
34
+ </div>
35
+
36
+ <div id="search-section" role="search" class="project-section initially-hidden">
37
+ <form action="#" method="get" accept-charset="utf-8">
38
+ <div id="search-field-wrapper">
39
+ <input id="search-field" role="combobox" aria-label="Search"
40
+ aria-autocomplete="list" aria-controls="search-results"
41
+ type="text" name="search" placeholder="Search" spellcheck="false"
42
+ title="Type to search, Up and Down to navigate, Enter to load">
43
+ </div>
44
+
45
+ <ul id="search-results" aria-label="Search Results"
46
+ aria-busy="false" aria-expanded="false"
47
+ aria-atomic="false" class="initially-hidden"></ul>
48
+ </form>
49
+ </div>
50
+
51
+ </div>
52
+
53
+
54
+
55
+ <div id="class-metadata">
56
+
57
+ <div id="parent-class-section" class="nav-section">
58
+ <h3>Parent</h3>
59
+
60
+
61
+ <p class="link"><a href="Object.html">Object</a>
62
+
63
+ </div>
64
+
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <div id="method-list-section" class="nav-section">
69
+ <h3>Methods</h3>
70
+
71
+ <ul class="link-list" role="directory">
72
+
73
+ <li ><a href="#method-c-new">::new</a>
74
+
75
+ <li ><a href="#method-i-each">#each</a>
76
+
77
+ <li ><a href="#method-i-insert">#insert</a>
78
+
79
+ <li ><a href="#method-i-to_s">#to_s</a>
80
+
81
+ </ul>
82
+ </div>
83
+
84
+ </div>
85
+ </nav>
86
+
87
+ <main role="main" aria-labelledby="class-APA">
88
+ <h1 id="class-APA" class="class">
89
+ class APA
90
+ </h1>
91
+
92
+ <section class="description">
93
+
94
+ </section>
95
+
96
+
97
+
98
+
99
+ <section id="5Buntitled-5D" class="documentation-section">
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
110
+ <header>
111
+ <h3>Public Class Methods</h3>
112
+ </header>
113
+
114
+
115
+ <div id="method-c-new" class="method-detail ">
116
+
117
+ <div class="method-heading">
118
+ <span class="method-name">new</span><span
119
+ class="method-args">()</span>
120
+
121
+ <span class="method-click-advice">click to toggle source</span>
122
+
123
+ </div>
124
+
125
+
126
+ <div class="method-description">
127
+
128
+
129
+
130
+
131
+
132
+
133
+ <div class="method-source-code" id="new-source">
134
+ <pre><span class="ruby-comment"># File lib/prct11/APA.rb, line 27</span>
135
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>()
136
+ <span class="ruby-ivar">@lista</span> = <span class="ruby-constant">LinkedList</span>.<span class="ruby-identifier">new</span>
137
+ <span class="ruby-ivar">@sufijo</span> = <span class="ruby-value">0</span>
138
+ <span class="ruby-keyword">end</span></pre>
139
+ </div>
140
+
141
+ </div>
142
+
143
+
144
+
145
+
146
+ </div>
147
+
148
+
149
+ </section>
150
+
151
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
152
+ <header>
153
+ <h3>Public Instance Methods</h3>
154
+ </header>
155
+
156
+
157
+ <div id="method-i-each" class="method-detail ">
158
+
159
+ <div class="method-heading">
160
+ <span class="method-name">each</span><span
161
+ class="method-args">() { |i| ... }</span>
162
+
163
+ <span class="method-click-advice">click to toggle source</span>
164
+
165
+ </div>
166
+
167
+
168
+ <div class="method-description">
169
+
170
+
171
+
172
+
173
+
174
+
175
+ <div class="method-source-code" id="each-source">
176
+ <pre><span class="ruby-comment"># File lib/prct11/APA.rb, line 55</span>
177
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>
178
+ <span class="ruby-ivar">@lista</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">i</span>}
179
+ <span class="ruby-keyword">end</span></pre>
180
+ </div>
181
+
182
+ </div>
183
+
184
+
185
+
186
+
187
+ </div>
188
+
189
+
190
+ <div id="method-i-insert" class="method-detail ">
191
+
192
+ <div class="method-heading">
193
+ <span class="method-name">insert</span><span
194
+ class="method-args">(reference)</span>
195
+
196
+ <span class="method-click-advice">click to toggle source</span>
197
+
198
+ </div>
199
+
200
+
201
+ <div class="method-description">
202
+
203
+
204
+
205
+
206
+
207
+
208
+ <div class="method-source-code" id="insert-source">
209
+ <pre><span class="ruby-comment"># File lib/prct11/APA.rb, line 32</span>
210
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">insert</span>(<span class="ruby-identifier">reference</span>)
211
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">&quot;La referencia no es de tipo referencia&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">reference</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Reference</span>)
212
+
213
+ <span class="ruby-comment"># Renombramos los autores para ordenar bien</span>
214
+ <span class="ruby-identifier">str</span> = <span class="ruby-string">&quot;&quot;</span>
215
+ <span class="ruby-identifier">reference</span>.<span class="ruby-identifier">authors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
216
+ <span class="ruby-comment"># raise ArgumentError, &quot;Uno de los autores no es un string&quot; unless a.is_a?(String)</span>
217
+ <span class="ruby-comment"># raise ArgumentError, &quot;Se especifica unicamente el nombre o el apellido&quot; unless a.split(&#39; &#39;).length &gt; 1</span>
218
+ <span class="ruby-identifier">element</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\W+/</span>)
219
+ <span class="ruby-identifier">str</span><span class="ruby-operator">+=</span><span class="ruby-identifier">element</span>[<span class="ruby-value">1</span>]
220
+ <span class="ruby-identifier">str</span><span class="ruby-operator">+=</span><span class="ruby-string">&quot;, &quot;</span>
221
+ <span class="ruby-keyword">unless</span> <span class="ruby-identifier">element</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">nil?</span>
222
+ <span class="ruby-identifier">str</span><span class="ruby-operator">+=</span><span class="ruby-identifier">element</span>[<span class="ruby-value">2</span>][<span class="ruby-value">0</span>]
223
+ <span class="ruby-identifier">str</span><span class="ruby-operator">+=</span><span class="ruby-string">&quot;.&quot;</span>
224
+ <span class="ruby-keyword">end</span>
225
+ <span class="ruby-identifier">str</span><span class="ruby-operator">+=</span><span class="ruby-identifier">element</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
226
+ <span class="ruby-identifier">str</span><span class="ruby-operator">+=</span><span class="ruby-string">&quot;.&quot;</span>
227
+ <span class="ruby-identifier">str</span><span class="ruby-operator">+=</span><span class="ruby-string">&quot; &amp; &quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">reference</span>.<span class="ruby-identifier">authors</span>.<span class="ruby-identifier">last</span>
228
+ <span class="ruby-keyword">end</span>
229
+ <span class="ruby-identifier">reference</span>.<span class="ruby-identifier">authors</span> = <span class="ruby-identifier">str</span>
230
+ <span class="ruby-ivar">@lista</span>.<span class="ruby-identifier">insert_by_end</span>(<span class="ruby-identifier">reference</span>)
231
+ <span class="ruby-keyword">end</span></pre>
232
+ </div>
233
+
234
+ </div>
235
+
236
+
237
+
238
+
239
+ </div>
240
+
241
+
242
+ <div id="method-i-to_s" class="method-detail ">
243
+
244
+ <div class="method-heading">
245
+ <span class="method-name">to_s</span><span
246
+ class="method-args">()</span>
247
+
248
+ <span class="method-click-advice">click to toggle source</span>
249
+
250
+ </div>
251
+
252
+
253
+ <div class="method-description">
254
+
255
+
256
+
257
+
258
+
259
+
260
+ <div class="method-source-code" id="to_s-source">
261
+ <pre><span class="ruby-comment"># File lib/prct11/APA.rb, line 59</span>
262
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
263
+ <span class="ruby-identifier">authorsPrev</span> = <span class="ruby-string">&quot;&quot;</span>
264
+ <span class="ruby-identifier">datePrev</span> = <span class="ruby-string">&quot;&quot;</span>
265
+ <span class="ruby-identifier">listSort</span> = <span class="ruby-ivar">@lista</span>.<span class="ruby-identifier">sort</span>
266
+ <span class="ruby-identifier">string</span> = <span class="ruby-string">&quot;&quot;</span>
267
+ <span class="ruby-identifier">listSort</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
268
+ <span class="ruby-keyword">if</span> (<span class="ruby-identifier">i</span>.<span class="ruby-identifier">instance_of?</span> <span class="ruby-constant">Book</span>)
269
+
270
+ <span class="ruby-comment"># Autores APA</span>
271
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span>
272
+
273
+ <span class="ruby-comment"># Año de publicacion APA</span>
274
+ <span class="ruby-identifier">element</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">date</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\//</span>)
275
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; (#{element[2]}&quot;</span>
276
+
277
+
278
+ <span class="ruby-keyword">if</span> (<span class="ruby-identifier">i</span>.<span class="ruby-identifier">date</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">datePrev</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">authorsPrev</span>)
279
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-ivar">@sufijo</span><span class="ruby-operator">+</span><span class="ruby-value">97</span>).<span class="ruby-identifier">chr</span>
280
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;). &quot;</span>
281
+ <span class="ruby-ivar">@sufijo</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
282
+ <span class="ruby-keyword">else</span>
283
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;). &quot;</span>
284
+ <span class="ruby-keyword">end</span>
285
+ <span class="ruby-identifier">authorsPrev</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span>
286
+ <span class="ruby-identifier">datePrev</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">date</span>
287
+
288
+ <span class="ruby-comment"># Título APA</span>
289
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #{i.title.capitalize} &quot;</span>
290
+
291
+ <span class="ruby-comment"># Edición APA</span>
292
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; (#{i.edition}) &quot;</span>
293
+
294
+ <span class="ruby-comment"># Volumen APA</span>
295
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; (#{i.volume}). &quot;</span>
296
+
297
+ <span class="ruby-comment"># Editorial APA</span>
298
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #{i.editorial} \n\n&quot;</span>
299
+ <span class="ruby-keyword">elsif</span> (<span class="ruby-identifier">i</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;JournalArticle&quot;</span>)
300
+ <span class="ruby-comment"># Autores APA</span>
301
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span>
302
+
303
+ <span class="ruby-comment"># fecha de publicacion APA</span>
304
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; (#{i.date}&quot;</span>
305
+
306
+ <span class="ruby-keyword">if</span> (<span class="ruby-identifier">i</span>.<span class="ruby-identifier">date</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">datePrev</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">authorsPrev</span>)
307
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-ivar">@sufijo</span><span class="ruby-operator">+</span><span class="ruby-value">97</span>).<span class="ruby-identifier">chr</span>
308
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;). &quot;</span>
309
+ <span class="ruby-ivar">@sufijo</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
310
+ <span class="ruby-keyword">else</span>
311
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;). &quot;</span>
312
+ <span class="ruby-keyword">end</span>
313
+ <span class="ruby-identifier">authorsPrev</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span>
314
+ <span class="ruby-identifier">datePrev</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">date</span>
315
+
316
+ <span class="ruby-comment"># Título articuloAPA</span>
317
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #{i.title.capitalize}. &quot;</span>
318
+
319
+ <span class="ruby-comment"># Nombre periodico APA</span>
320
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #{i.journal}, &quot;</span>
321
+
322
+ <span class="ruby-comment"># Número de paginas APA</span>
323
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #{i.finalpage}.\n\n &quot;</span>
324
+ <span class="ruby-keyword">elsif</span> (<span class="ruby-identifier">i</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;electronicdocument&quot;</span>)
325
+ <span class="ruby-comment"># Autores APA</span>
326
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span>
327
+
328
+ <span class="ruby-comment"># fecha de publicacion APA</span>
329
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; (#{i.date}&quot;</span>
330
+
331
+ <span class="ruby-keyword">if</span> (<span class="ruby-identifier">i</span>.<span class="ruby-identifier">date</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">datePrev</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">authorsPrev</span>)
332
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-ivar">@sufijo</span><span class="ruby-operator">+</span><span class="ruby-value">97</span>).<span class="ruby-identifier">chr</span>
333
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;). &quot;</span>
334
+ <span class="ruby-ivar">@sufijo</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
335
+ <span class="ruby-keyword">else</span>
336
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;). &quot;</span>
337
+ <span class="ruby-keyword">end</span>
338
+ <span class="ruby-identifier">authorsPrev</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">authors</span>
339
+ <span class="ruby-identifier">datePrev</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">date</span>
340
+
341
+ <span class="ruby-comment"># Título articuloAPA</span>
342
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #{i.title.capitalize}&quot;</span>
343
+
344
+ <span class="ruby-comment"># Edición articuloAPA</span>
345
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; (#{i.edition}).&quot;</span>
346
+
347
+ <span class="ruby-comment"># Nombre periodico APA</span>
348
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; [#{i.journal}] &quot;</span>
349
+
350
+ <span class="ruby-comment"># URL de paginas APA</span>
351
+ <span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #{i.url}.\n\n &quot;</span>
352
+ <span class="ruby-keyword">end</span>
353
+ <span class="ruby-keyword">end</span>
354
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">string</span>
355
+ <span class="ruby-keyword">end</span></pre>
356
+ </div>
357
+
358
+ </div>
359
+
360
+
361
+
362
+
363
+ </div>
364
+
365
+
366
+ </section>
367
+
368
+ </section>
369
+ </main>
370
+
371
+
372
+ <footer id="validator-badges" role="contentinfo">
373
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
374
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
375
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
376
+ </footer>
377
+