Class: Biblio

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/nitz/codigo.rb

Direct Known Subclasses

Electronico, Libro, Periodico, Revista

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Biblio

Returns a new instance of Biblio.



5
6
7
8
9
# File 'lib/nitz/codigo.rb', line 5

def initialize(&block)
    if block_given?  
        instance_eval &block
    end
end

Instance Attribute Details

#apellidoObject (readonly)

Returns the value of attribute apellido.



3
4
5
# File 'lib/nitz/codigo.rb', line 3

def apellido
  @apellido
end

#autorObject (readonly)

Returns the value of attribute autor.



3
4
5
# File 'lib/nitz/codigo.rb', line 3

def autor
  @autor
end

#edicionObject (readonly)

Returns the value of attribute edicion.



3
4
5
# File 'lib/nitz/codigo.rb', line 3

def edicion
  @edicion
end

#editorialObject (readonly)

Returns the value of attribute editorial.



3
4
5
# File 'lib/nitz/codigo.rb', line 3

def editorial
  @editorial
end

#fechaObject (readonly)

Returns the value of attribute fecha.



3
4
5
# File 'lib/nitz/codigo.rb', line 3

def fecha
  @fecha
end

#isbnObject (readonly)

Returns the value of attribute isbn.



3
4
5
# File 'lib/nitz/codigo.rb', line 3

def isbn
  @isbn
end

#serieObject (readonly)

Returns the value of attribute serie.



3
4
5
# File 'lib/nitz/codigo.rb', line 3

def serie
  @serie
end

#tituloObject (readonly)

Returns the value of attribute titulo.



3
4
5
# File 'lib/nitz/codigo.rb', line 3

def titulo
  @titulo
end

Instance Method Details

#<=>(other) ⇒ Object



11
12
13
# File 'lib/nitz/codigo.rb', line 11

def <=> (other)
    @edicion <=> other.edicion
end

#obtenautorObject



15
16
17
# File 'lib/nitz/codigo.rb', line 15

def obtenautor
 @autor
end

#obtenedicionObject



31
32
33
# File 'lib/nitz/codigo.rb', line 31

def obtenedicion
 @edicion
end

#obteneditorialObject



27
28
29
# File 'lib/nitz/codigo.rb', line 27

def obteneditorial
 @editorial
end

#obtenfechaObject



35
36
37
# File 'lib/nitz/codigo.rb', line 35

def obtenfecha
 @fecha
end

#obtenisbnObject



39
40
41
# File 'lib/nitz/codigo.rb', line 39

def obtenisbn
 @isbn
end

#obtenserieObject



23
24
25
# File 'lib/nitz/codigo.rb', line 23

def obtenserie
 @serie
end

#obtentituloObject



19
20
21
# File 'lib/nitz/codigo.rb', line 19

def obtentitulo
 @titulo
end

#to_sObject



43
44
45
# File 'lib/nitz/codigo.rb', line 43

def to_s
    "Autor: #@autor, Titulo: #@titulo, Serie: #@serie, Editorial: #@editorial, #@edicion Edicion, Fecha de Publicacion: #@fecha y ISBN: #@isbn"
end