Class: Examen::Interfaz

Inherits:
Object
  • Object
show all
Defined in:
lib/examen/interfaz.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Interfaz

Returns a new instance of Interfaz.



15
16
17
18
19
# File 'lib/examen/interfaz.rb', line 15

def initialize(args)
    @examen=args[:examen]
    
    
end

Instance Attribute Details

#examenObject (readonly)

Returns the value of attribute examen.



14
15
16
# File 'lib/examen/interfaz.rb', line 14

def examen
  @examen
end

Instance Method Details

#to_sObject



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/examen/interfaz.rb', line 21

def to_s
       aux = @examen.inicio
       respuesta = ""
       respuesta += aux.value.to_s
       respuesta += "\n"
       while (aux != @examen.fin) do
           aux = aux.next
           respuesta += aux.value.to_s
           respuesta += "\n"
       end
       respuesta
end