Class: Libro

Inherits:
Biblio show all
Defined in:
lib/bibliografia/biblio.rb

Instance Attribute Summary collapse

Attributes inherited from Biblio

#autor, #fecha, #titulo

Instance Method Summary collapse

Methods inherited from Biblio

#<=>, #to_s

Constructor Details

#initialize(titulo, &block) ⇒ Libro

Returns a new instance of Libro.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/bibliografia/biblio.rb', line 59

def initialize(titulo,&block)
    
     self.titulo = titulo
     self.autor = []
     self.fecha = []
     self.edicion = []
     self.volumen = []
     self.lpublicacion = []
     self.edito = []
     
     
     if block_given?  
          if block.arity == 1
               yield self
          else
               instance_eval &block 
          end
     end
end

Instance Attribute Details

#edicionObject

Returns the value of attribute edicion.



57
58
59
# File 'lib/bibliografia/biblio.rb', line 57

def edicion
  @edicion
end

#editoObject

Returns the value of attribute edito.



57
58
59
# File 'lib/bibliografia/biblio.rb', line 57

def edito
  @edito
end

#lpublicacionObject

Returns the value of attribute lpublicacion.



57
58
59
# File 'lib/bibliografia/biblio.rb', line 57

def lpublicacion
  @lpublicacion
end

#volumenObject

Returns the value of attribute volumen.



57
58
59
# File 'lib/bibliografia/biblio.rb', line 57

def volumen
  @volumen
end

Instance Method Details

#author(name, options = {}) ⇒ Object



84
85
86
87
# File 'lib/bibliografia/biblio.rb', line 84

def author(name, options = {})
     author = name
     autor << author
end

#date(name, options = {}) ⇒ Object



79
80
81
82
# File 'lib/bibliografia/biblio.rb', line 79

def date(name, options = {})
     date = name
     fecha << date
end

#edition(name, options = {}) ⇒ Object



89
90
91
92
# File 'lib/bibliografia/biblio.rb', line 89

def edition(name, options = {})
     edition = name
     edicion << edition
end

#editor(name, options = {}) ⇒ Object



104
105
106
107
# File 'lib/bibliografia/biblio.rb', line 104

def editor(name, options = {})
     editor = name
     edito << editor
end

#place(name, options = {}) ⇒ Object



99
100
101
102
# File 'lib/bibliografia/biblio.rb', line 99

def place(name, options = {})
     place = name
     lpublicacion << place
end

#volume(name, options = {}) ⇒ Object



94
95
96
97
# File 'lib/bibliografia/biblio.rb', line 94

def volume(name, options = {})
     volume = name
     volumen << volume
end