class Electronico

Attributes

autor[R]
url[R]

Public Class Methods

new(titulo) { |self| ... } click to toggle source
# File lib/Bib/Bib.rb, line 165
def initialize(titulo, &block)
    @titulo = titulo
    @autor = []
    @url = []
    
    if block_given?
        if block.arity == 1
            yield self
        else
            instance_eval &block
        end
    end
end

Public Instance Methods

author(text, options = {}) click to toggle source
# File lib/Bib/Bib.rb, line 179
def author(text, options = {})
    author = text
    author << "(#{options[:name]})" if options[:name]
    autor << author
end
n_url(text, options = {}) click to toggle source
# File lib/Bib/Bib.rb, line 185
def n_url(text, options = {})
    n_url = text
    n_url << "(#{options[:direccion]})" if options[:direccion]
    url << n_url
end
to_s() click to toggle source
# File lib/Bib/Bib.rb, line 191
def to_s()
    output = titulo
    output << ", #{autor.join(', ')}, #{url.join(', ')}\n\n"
    output
end