class Edocumento

Attributes

dir_url[RW]

Public Class Methods

new() click to toggle source
Calls superclass method Publicacion.new
# File lib/biblio/edocumento.rb, line 4
def initialize
    super
end

Public Instance Methods

to_s() click to toggle source
# File lib/biblio/edocumento.rb, line 13
def to_s
    # formateamos autores
    str_autores = ""
    @autores.each do |autor|
        str_autores += autor + ", "
    end
    str_autores = str_autores[0, str_autores.length - 2]
    if @autores.length > 1
        str_autores = str_autores.sub(", " + @autores.last, " & " + @autores.last)
    end
    
    # generamos string de salida
    salida=""
    if(@pfin != nil)
        salida = "#{str_autores} (#{@date_p.strftime("%d, %B %Y")}). #{@title}.\n\t#{@editor}, p. #{@pinicio} - #{@pfin}.\n\tISSN: #{@issn}\n\tDisponible en: #{@dir_url}"
    else
        salida = "#{str_autores} (#{@date_p.strftime("%d, %B %Y")}).\n\t#{@title}.\n\t#{@editor}, p. #{@pinicio}.\n\tISSN: #{@issn}\n\tDisponible en: #{@dir_url}"
    end
    salida
end
url(text) click to toggle source
# File lib/biblio/edocumento.rb, line 8
def url(text)
    raise ArgumentError, "La url debe ser de tipo String" unless text.is_a?(String)
    @dir_url = text
end