class Test
Attributes
a[R]
a1[R]
q[R]
t[R]
Public Class Methods
new(q,a1,t,a)
click to toggle source
# File lib/my_gem/test.rb, line 4 def initialize(q,a1,t,a) @q, @a1, @t, @a= q, a1, t, a end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/my_gem/test.rb, line 7 def <=> other return nil unless other.is_a?(self.class) [self.q, self.a1, self.t, self.a] <=> [other.q, other.a1, other.t, other.a] end
show()
click to toggle source
@return Muestra las preguntas normales y sus respuestas por pantalla.
# File lib/my_gem/test.rb, line 12 def show() #print "Pregunta: ", q, "\n" for i in(0...a1.size) #print "\n ", i+1, ")", a1[i] end #puts "\n\nElige una de las opciones." for i in(0...a1.size) if @a == i+1 @a = a1[i] end end #print "\nLa respuesta correcta es: ", a, "\n" end