Class: RefBiblio::Libro

Inherits:
Referencia 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(&block) ⇒ Libro

Returns a new instance of Libro.



122
123
124
125
126
127
128
129
130
# File 'lib/refBiblio/referencia.rb', line 122

def initialize(&block)
	if block_given?
		if block.arity == 1 
			yield self
		else
			instance_eval &block 
		end
	end
end

Instance Attribute Details

#edicion(edicion) ⇒ Object

Parameters:

  • edicion (edicion)

    Edicion del libro



121
122
123
# File 'lib/refBiblio/referencia.rb', line 121

def edicion
  @edicion
end

#volumen(volumen) ⇒ Object

Parameters:

  • volumen (volumen)

    Volumen del libro



121
122
123
# File 'lib/refBiblio/referencia.rb', line 121

def volumen
  @volumen
end

Instance Method Details

#to_sObject

Returns Cadena de caracteres de la referencia del libro formateado.

Returns:

  • Cadena de caracteres de la referencia del libro formateado



146
147
148
149
# File 'lib/refBiblio/referencia.rb', line 146

def to_s
	string=""
	string  << @autor << " (" << Date::MONTHNAMES[get_publicacion.month] << " " << get_publicacion.day.to_s << ", " << get_publicacion.year.to_s << "). " << @titulo << " (" << @edicion.to_s << ") (" << @volumen.to_s << "). " << @editorial << "."
end