Class: Examen::Interfaz
- Inherits:
-
Object
- Object
- Examen::Interfaz
- Defined in:
- lib/examen/interfaz.rb
Instance Attribute Summary collapse
-
#examen ⇒ Object
readonly
Returns the value of attribute examen.
Instance Method Summary collapse
-
#initialize(args) ⇒ Interfaz
constructor
A new instance of Interfaz.
- #to_s ⇒ Object
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
#examen ⇒ Object (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_s ⇒ Object
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 |