Class: RefBiblio::ArtPeriodico

Inherits:
Periodicas show all
Defined in:
lib/refBiblio/referencia.rb

Instance Attribute Summary collapse

Attributes inherited from Referencia

#autor, #editorial, #publicacion, #titulo

Instance Method Summary collapse

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

#formatoObject

Author:

  • Rafael Herrero



169
170
171
# File 'lib/refBiblio/referencia.rb', line 169

def formato
  @formato
end

#paginas(paginas) ⇒ Object

Parameters:

  • paginas (paginas)

    Numero de paginas del articulo periodistico



169
170
171
# File 'lib/refBiblio/referencia.rb', line 169

def paginas
  @paginas
end

Instance Method Details

#to_sObject

Returns String de la referencia del articulo periodistico formateado.

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