Class: Exam::Interfaz
- Inherits:
-
Object
- Object
- Exam::Interfaz
- Defined in:
- lib/exam/interfaz.rb
Overview
create a Interfaz
Instance Attribute Summary collapse
-
#examen ⇒ Object
Returns the value of attribute examen.
Instance Method Summary collapse
- #examinar ⇒ Object
-
#initialize(e) ⇒ Interfaz
constructor
A new instance of Interfaz.
- #invertir_examen ⇒ Object
- #mostrar ⇒ Object
- #responder ⇒ Object
Constructor Details
#initialize(e) ⇒ Interfaz
Returns a new instance of Interfaz.
7 8 9 |
# File 'lib/exam/interfaz.rb', line 7 def initialize(e) @examen = e end |
Instance Attribute Details
#examen ⇒ Object
Returns the value of attribute examen.
5 6 7 |
# File 'lib/exam/interfaz.rb', line 5 def examen @examen end |
Instance Method Details
#examinar ⇒ Object
24 25 26 27 |
# File 'lib/exam/interfaz.rb', line 24 def examinar mostrar responder end |
#invertir_examen ⇒ Object
29 30 31 |
# File 'lib/exam/interfaz.rb', line 29 def invertir_examen @examen.invertir end |
#mostrar ⇒ Object
11 12 13 |
# File 'lib/exam/interfaz.rb', line 11 def mostrar puts @examen.to_s end |
#responder ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/exam/interfaz.rb', line 15 def responder a=[] for i in 0..@examen.size-1 puts "Respuesta a la pregunta #{i+1}: " a=a+[gets.chomp] end @examen.check_exam(a) end |