class Bibliografia::Bibliografia

Attributes

autor[RW]
fecha_publicacion[RW]
titulo[RW]

Public Class Methods

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

Public Instance Methods

<=>(other) click to toggle source
# File lib/Bibliografia/Bibliografia.rb, line 22
def <=>(other)
        #return nil unless other.kind_of? Bibliografia::Bibliografia
                
        #return nil unless other.kind_of? Bibliografia::Bibliografia
        if((@autor == other.autor)== 0)
                        if((@fecha_publicacion <=> other.fecha_publicacion)==0)
                                @titulo <=> other.titulo
                        else
                                @fecha_publicacion <=> other.fecha_publicacion
                        end
        else
                @autor <=> other.autor
                
        end
end