class Biblio

Attributes

autor[RW]
fecha[RW]
titulo[RW]

Public Class Methods

new(titulo) { |self| ... } click to toggle source
# File lib/bibliografia/biblio.rb, line 7
def initialize(titulo, &block)

     self.titulo = titulo
     self.autor = []
     self.fecha = []

     if block_given?  
          if block.arity == 1
               yield self
          else
               instance_eval &block 
          end
     end
end

Public Instance Methods

<=>(anOther) click to toggle source
# File lib/bibliografia/biblio.rb, line 33
def <=>(anOther)
     if((@autor <=> anOther.autor) == 0)
          if((@fecha <=> anOther.fecha)==0)
               
               @titulo <=> anOther.titulo
           
          else
               @fecha <=> anOther.fecha
          end
     else
          @autor <=> anOther.autor
     end
end
author(name, options = {}) click to toggle source
# File lib/bibliografia/biblio.rb, line 28
def author(name, options = {})
     author = name
     autor << author
end
date(name, options = {}) click to toggle source
# File lib/bibliografia/biblio.rb, line 22
def date(name, options = {})
     date = name
     
     fecha << date
end
to_s() click to toggle source
# File lib/bibliografia/biblio.rb, line 48
def to_s()

end