class CitaLibro
Attributes
edicion[RW]
editor[RW]
subtitle[RW]
title[RW]
volumen[RW]
Public Class Methods
new(author, date, titulo, subtitulo, editor, edicion, volumen)
click to toggle source
Calls superclass method
Cita::new
# File lib/lpp_Grupo3/cita.rb, line 44 def initialize(author, date, titulo, subtitulo, editor, edicion, volumen) super(author, date, titulo) self.title=titulo self.subtitle=subtitulo self.editor=editor self.edicion=edicion self.volumen=volumen end
Public Instance Methods
libro(datos = {})
click to toggle source
# File lib/lpp_Grupo3/cita.rb, line 53 def libro (datos = {}) self.titulo = datos[:titulo] self.title = datos[:titulo] self.subtitle = datos[:subtitulo] self.editor = datos[:editor] self.edicion = datos[:edicion] self.volumen = datos[:volumen] end
to_s()
click to toggle source
# File lib/lpp_Grupo3/cita.rb, line 72 def to_s text="" for i in (0..author.size-2) text << " #{self.author[i][0]}, #{(self.author[i][1])[0]}. &" end text << " #{self.author[author.size-1][0]}, #{(self.author[self.author.size-1][1])[0]}." text << " (#{self.datey}" if (self.sufijo>0) text << (self.sufijo+96).chr end text << "). #{self.title}: " text << " #{self.subtitle}." text << " (#{self.edicion}) " text << " (#{self.volumen})." text << " #{self.editor}." text end