Class: Articulo
Instance Attribute Summary collapse
-
#editor ⇒ Object
Returns the value of attribute editor.
-
#obra ⇒ Object
Returns the value of attribute obra.
-
#paginas ⇒ Object
Returns the value of attribute paginas.
Attributes inherited from Biblio
Instance Method Summary collapse
- #author(name, options = {}) ⇒ Object
- #date(name, options = {}) ⇒ Object
- #edit(name, options = {}) ⇒ Object
-
#initialize(titulo, &block) ⇒ Articulo
constructor
A new instance of Articulo.
- #obr(name, options = {}) ⇒ Object
- #pag(name, options = {}) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Biblio
Constructor Details
#initialize(titulo, &block) ⇒ Articulo
Returns a new instance of Articulo.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/biblioalu0100815146/biblio.rb', line 119 def initialize(titulo,&block) self.titulo = titulo self.autor = [] self.fecha = [] self.editor = [] self.paginas = [] self.obra = [] if block_given? if block.arity == 1 yield self else instance_eval &block end end end |
Instance Attribute Details
#editor ⇒ Object
Returns the value of attribute editor.
118 119 120 |
# File 'lib/biblioalu0100815146/biblio.rb', line 118 def editor @editor end |
#obra ⇒ Object
Returns the value of attribute obra.
118 119 120 |
# File 'lib/biblioalu0100815146/biblio.rb', line 118 def obra @obra end |
#paginas ⇒ Object
Returns the value of attribute paginas.
118 119 120 |
# File 'lib/biblioalu0100815146/biblio.rb', line 118 def paginas @paginas end |
Instance Method Details
#author(name, options = {}) ⇒ Object
143 144 145 146 147 |
# File 'lib/biblioalu0100815146/biblio.rb', line 143 def (name, = {}) = name << " (#{[:amount]})" if [:amount] autor << end |
#date(name, options = {}) ⇒ Object
138 139 140 141 |
# File 'lib/biblioalu0100815146/biblio.rb', line 138 def date(name, = {}) date = name fecha << date end |
#edit(name, options = {}) ⇒ Object
149 150 151 152 |
# File 'lib/biblioalu0100815146/biblio.rb', line 149 def edit(name, = {}) edit = name editor << edit end |
#obr(name, options = {}) ⇒ Object
157 158 159 160 |
# File 'lib/biblioalu0100815146/biblio.rb', line 157 def obr(name, = {}) obr = name obra << obr end |
#pag(name, options = {}) ⇒ Object
153 154 155 156 |
# File 'lib/biblioalu0100815146/biblio.rb', line 153 def pag(name, = {}) pag = name paginas << pag end |
#to_s ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/biblioalu0100815146/biblio.rb', line 162 def to_s() output = titulo output << " #{autor.join(', ')} " output << "(#{fecha.join(', ')}) " output << "(#{editor.join(', ')}) " output << "(#{paginas.join(', ')}) " output << "#{obra.join(', ')} " output end |