Class: Biblioteca

Inherits:
Object
  • Object
show all
Defined in:
lib/refbiblio_alu0100505078/biblio.rb

Overview

Clase que representa la bliblioteca

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(autor, isbn, titulo, fecha, editorial, edicion) ⇒ Biblioteca

Returns a new instance of Biblioteca.



5
6
7
8
9
10
11
12
13
14
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 5

def initialize(autor,isbn,titulo,fecha,editorial,edicion)

   #variables de instancia
		@autor=autor
		@isbn=isbn
		@titulo=titulo
		@fecha_publicacion=fecha
		@editorial=editorial
		@num_edicion=edicion
end

Instance Attribute Details

#autorObject (readonly)

Returns the value of attribute autor.



4
5
6
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 4

def autor
  @autor
end

#editorialObject (readonly)

Returns the value of attribute editorial.



4
5
6
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 4

def editorial
  @editorial
end

#fecha_publicacionObject (readonly)

Returns the value of attribute fecha_publicacion.



4
5
6
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 4

def fecha_publicacion
  @fecha_publicacion
end

#isbnObject (readonly)

Returns the value of attribute isbn.



4
5
6
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 4

def isbn
  @isbn
end

#num_edicionObject (readonly)

Returns the value of attribute num_edicion.



4
5
6
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 4

def num_edicion
  @num_edicion
end

#serieObject (readonly)

Returns the value of attribute serie.



4
5
6
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 4

def serie
  @serie
end

#tituloObject (readonly)

Returns the value of attribute titulo.



4
5
6
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 4

def titulo
  @titulo
end

Instance Method Details

#formatoObject

metodo que muestra la referencia formateada de la biblioteca



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 25

def formato
puts "------------------------------------------------------------------------------------"
 @autor.each do |aut|
   print aut+","
 end
 puts "\n"+@titulo
 print @serie
 puts @editorial+" : "+edicion+" "+@fecha_serie
 
 #aƱadi self.isbn porque por algun motivo mostraba dos veces el contenido del array
 
 puts self.isbn
 puts "------------------------------------------------------------------------------------"
end

#set_serie(serie) ⇒ Object

metodo para insertar la serie del libro



17
18
19
20
# File 'lib/refbiblio_alu0100505078/biblio.rb', line 17

def set_serie(serie)
	 	@serie=serie
	 
end