Class: Biblioref
Instance Attribute Summary collapse
-
#author_name ⇒ Object
Nombres de autores.
-
#author_surname ⇒ Object
Apellidos de autores.
-
#edit_num ⇒ Object
Numero de edición.
-
#p_date ⇒ Object
Fecha de publicación.
-
#p_house ⇒ Object
Casa editorial.
-
#p_place ⇒ Object
Lugar de publicación.
-
#title_ ⇒ Object
Título de publicación.
-
#volume ⇒ Object
Volumen.
Instance Method Summary collapse
- #<=>(another) ⇒ Object
-
#initialize(params = {}) ⇒ Biblioref
constructor
A new instance of Biblioref.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Biblioref
Returns a new instance of Biblioref.
13 14 15 16 17 |
# File 'lib/dsl/references.rb', line 13 def initialize(params = {}) self. = [] self. = [] end |
Instance Attribute Details
#author_name ⇒ Object
Nombres de autores
5 6 7 |
# File 'lib/dsl/references.rb', line 5 def @author_name end |
#author_surname ⇒ Object
Apellidos de autores
6 7 8 |
# File 'lib/dsl/references.rb', line 6 def @author_surname end |
#edit_num ⇒ Object
Numero de edición
10 11 12 |
# File 'lib/dsl/references.rb', line 10 def edit_num @edit_num end |
#p_date ⇒ Object
Fecha de publicación
11 12 13 |
# File 'lib/dsl/references.rb', line 11 def p_date @p_date end |
#p_house ⇒ Object
Casa editorial
8 9 10 |
# File 'lib/dsl/references.rb', line 8 def p_house @p_house end |
#p_place ⇒ Object
Lugar de publicación
9 10 11 |
# File 'lib/dsl/references.rb', line 9 def p_place @p_place end |
#title_ ⇒ Object
Título de publicación
7 8 9 |
# File 'lib/dsl/references.rb', line 7 def title_ @title_ end |
#volume ⇒ Object
Volumen
12 13 14 |
# File 'lib/dsl/references.rb', line 12 def volume @volume end |
Instance Method Details
#<=>(another) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/dsl/references.rb', line 33 def <=> (another) if (self. != another.) self.<=>another. elsif (self. == another. && self.p_date!=another.p_date) self.<=>another. self.p_date<=>another.p_date end end |
#to_s ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/dsl/references.rb', line 19 def to_s fullnames = "" i=0 while i < self..count if i != self..count-1 fullnames= fullnames + "#{self.[i]}, #{self.[i][0]}. & " else fullnames= fullnames + "#{self.[i]}, #{self.[i][0]}." end i=i+1 end "#{fullnames} (#{self.p_date}). #{self.title_} (#{self.edit_num}) (#{self.volume}). #{self.p_place}: #{self.p_house}." end |