class Libro

Public Class Methods

new(title,editorial,edicion,date,isbn,authors,*serie) click to toggle source

CONSTRUCTOR

Calls superclass method G03ref.new
# File lib/lpp_Grupo3/reference.rb, line 32
def initialize(title,editorial,edicion,date,isbn,authors,*serie)
        super(authors,title,date)
        
@serie = serie
@editorial = editorial
@edicion = edicion

self.isbn = []
isbn.each do |numeros|
    @isbn.push(numeros)
end
return self
end

Public Instance Methods

get_edition() click to toggle source
# File lib/lpp_Grupo3/reference.rb, line 52
def get_edition
    @edicion
end
get_editorial() click to toggle source
# File lib/lpp_Grupo3/reference.rb, line 49
def get_editorial
    @editorial
end
get_isbn() click to toggle source
# File lib/lpp_Grupo3/reference.rb, line 56
def get_isbn
    @isbn
end
get_serie() click to toggle source
# File lib/lpp_Grupo3/reference.rb, line 46
def get_serie
    @serie
end
to_s() click to toggle source
# File lib/lpp_Grupo3/reference.rb, line 59
def to_s
        text=""
        
    for i in (0..@authors.size-2)
        text << "#{authors[i]} , " 
    end
    text << "#{authors[authors.size-1]}."
    text << "\n#{@title}."
    if @serie.size==1
        text << "\n(#{@serie[0]})."
    end
     text << "\n#{@editorial}; #{@edicion} Edicion (#{@date})."
    for i in (0..@isbn.size-1)
        text << "\nISBN #{@isbn[i].length}: #{@isbn[i]}."
    end
    text
end