Class: Listaa::Libro
- Inherits:
-
Bibliografia
- Object
- Bibliografia
- Listaa::Libro
- Defined in:
- lib/Lista/Libro.rb
Instance Attribute Summary collapse
-
#ISBN ⇒ Object
readonly
Returns the value of attribute ISBN.
Attributes inherited from Bibliografia
#Author, #Edicion, #Editorial, #Fecha_Publication, #Serie, #Title
Instance Method Summary collapse
- #add_ISBN(fech, num) ⇒ Object
-
#initialize(nombre = "", &block) ⇒ Libro
constructor
A new instance of Libro.
- #isbn(fech, num) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Bibliografia
#<=>, #add_author, #add_editorial, #add_serie, #add_title, #autor, #autorTo_s, #edicion, #editorial, #fecha, #get_formato, #get_tipo, #set_edicion, #set_publication
Constructor Details
#initialize(nombre = "", &block) ⇒ Libro
Returns a new instance of Libro.
5 6 7 8 9 10 |
# File 'lib/Lista/Libro.rb', line 5 def initialize(nombre = "",&block) super(nombre) @Tipo = "Libro" @ISBN = [] instance_eval &block end |
Instance Attribute Details
#ISBN ⇒ Object (readonly)
Returns the value of attribute ISBN.
4 5 6 |
# File 'lib/Lista/Libro.rb', line 4 def ISBN @ISBN end |
Instance Method Details
#add_ISBN(fech, num) ⇒ Object
12 13 14 |
# File 'lib/Lista/Libro.rb', line 12 def add_ISBN(fech,num) @ISBN << [fech,num] end |
#isbn(fech, num) ⇒ Object
20 21 22 |
# File 'lib/Lista/Libro.rb', line 20 def isbn(fech,num) @ISBN << [fech,num] end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/Lista/Libro.rb', line 16 def to_s f = autorTo_s+"("+@Fecha_Publication.to_s+"). "+@Title+" ("+@Edicion.to_s+"). "+@Editorial end |