Class: Libro

Inherits:
Biblio show all
Defined in:
lib/nitz/codigo.rb

Instance Attribute Summary collapse

Attributes inherited from Biblio

#apellido, #autor, #edicion, #editorial, #fecha, #serie, #titulo

Instance Method Summary collapse

Methods inherited from Biblio

#<=>, #obtenautor, #obtenedicion, #obteneditorial, #obtenfecha, #obtenisbn, #obtenserie, #obtentitulo

Constructor Details

#initialize(&block) ⇒ Libro

Returns a new instance of Libro.



51
52
53
54
55
56
57
58
59
# File 'lib/nitz/codigo.rb', line 51

def initialize (&block)
   if block_given?  
    if block.arity == 1
        yield self
    else
        instance_eval &block 
    end
   end
end

Instance Attribute Details

#isbn(isbn) ⇒ Object

Returns the value of attribute isbn.



49
50
51
# File 'lib/nitz/codigo.rb', line 49

def isbn
  @isbn
end

Instance Method Details

#to_sObject



65
66
67
# File 'lib/nitz/codigo.rb', line 65

def to_s
    "ISBN: #@isbn"
end