Class: RefBiblio::ArtPeriodico
- Inherits:
-
Periodicas
- Object
- Referencia
- Periodicas
- RefBiblio::ArtPeriodico
- Defined in:
- lib/refBiblio/referencia.rb
Instance Attribute Summary collapse
Attributes inherited from Referencia
#autor, #editorial, #publicacion, #titulo
Instance Method Summary collapse
-
#initialize(formato, &block) ⇒ ArtPeriodico
constructor
A new instance of ArtPeriodico.
-
#to_s ⇒ Object
String de la referencia del articulo periodistico formateado.
Methods inherited from Referencia
#<=>, #get_autor, #get_editorial, #get_publicacion, #get_titulo
Constructor Details
#initialize(formato, &block) ⇒ ArtPeriodico
Returns a new instance of ArtPeriodico.
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/refBiblio/referencia.rb', line 170 def initialize(formato, &block) if block_given? if block.arity == 1 yield self else instance_eval &block end end super(formato) end |
Instance Attribute Details
#formato ⇒ Object
169 170 171 |
# File 'lib/refBiblio/referencia.rb', line 169 def formato @formato end |
#paginas(paginas) ⇒ Object
169 170 171 |
# File 'lib/refBiblio/referencia.rb', line 169 def paginas @paginas end |
Instance Method Details
#to_s ⇒ Object
Returns String de la referencia del articulo periodistico formateado.
189 190 191 192 |
# File 'lib/refBiblio/referencia.rb', line 189 def to_s string = "" string << @autor << " (" << Date::MONTHNAMES[get_publicacion.month] << " " << get_publicacion.day.to_s << ", " << get_publicacion.year.to_s << "). " << @titulo << ". " << @editorial << ", pp. " << @formato << ", " << @paginas.to_s << " paginas" << "." end |