Class: EBook
Instance Attribute Summary collapse
-
#editor_name ⇒ Object
Título de artículo.
-
#editor_surname ⇒ Object
Título de artículo.
-
#page ⇒ Object
Título de artículo.
-
#title_a ⇒ Object
Título de artículo.
Attributes inherited from Biblioref
#author_name, #author_surname, #edit_num, #p_date, #p_house, #p_place, #title_, #volume
Instance Method Summary collapse
- #<=>(another) ⇒ Object
-
#initialize(params = {}, &block) ⇒ EBook
constructor
A new instance of EBook.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}, &block) ⇒ EBook
Returns a new instance of EBook.
66 67 68 69 70 71 |
# File 'lib/dsl/references.rb', line 66 def initialize(params = {}, &block) super self.editor_name = [] self.editor_surname = [] instance_eval &block end |
Instance Attribute Details
#editor_name ⇒ Object
Título de artículo
62 63 64 |
# File 'lib/dsl/references.rb', line 62 def editor_name @editor_name end |
#editor_surname ⇒ Object
Título de artículo
62 63 64 |
# File 'lib/dsl/references.rb', line 62 def editor_surname @editor_surname end |
#page ⇒ Object
Título de artículo
62 63 64 |
# File 'lib/dsl/references.rb', line 62 def page @page end |
#title_a ⇒ Object
Título de artículo
62 63 64 |
# File 'lib/dsl/references.rb', line 62 def title_a @title_a end |
Instance Method Details
#<=>(another) ⇒ Object
99 100 101 102 103 104 105 106 |
# File 'lib/dsl/references.rb', line 99 def <=>(another) if self.== another. && self.p_date==another.p_date self.<=>another. self.title_a<=>another.title_a else super end end |
#to_s ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/dsl/references.rb', line 73 def to_s editors = "" 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 i=0 while i < self.editor_name.count if i == self.editor_name.count-1 editors= editors + "#{self.editor_name[i][0]}. #{self.editor_surname[i]}" elsif i == self.editor_name.count-2 editors= editors + "#{self.editor_name[i][0]}. #{self.editor_surname[i]} & " else editors= editors + "#{self.editor_name[i][0]}. #{self.editor_surname[i]}, " end i=i+1 end "#{fullnames} (#{self.p_date}). #{self.title_a}. En #{editors} (comps), #{self.title_} (pp. #{self.page}) (#{self.edit_num}) (#{self.volume}). #{self.p_place}: #{self.p_house}." end |