class Examen::Pregunta

Attributes

enunciado[R]

use a class to define behavior, together with a Struct that defines the data to which the class should be initialized.

falsas[R]

use a class to define behavior, together with a Struct that defines the data to which the class should be initialized.

respuesta[R]

use a class to define behavior, together with a Struct that defines the data to which the class should be initialized.

valor[R]

use a class to define behavior, together with a Struct that defines the data to which the class should be initialized.

Public Class Methods

new(arg) click to toggle source
# File lib/examen/pregunta.rb, line 21
def initialize(arg)
    @valor=arg[:valor]
    @enunciado=arg[:enunciado]
    @respuesta=arg[:respuesta]
    @falsas=arg[:falsas]
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/examen/pregunta.rb, line 44
def <=> other
    #return nil unless other.is_a? Examen
     self.valor <=> other.valor
end
extresp() click to toggle source
# File lib/examen/pregunta.rb, line 29
def extresp 
     
     "RESPUESTAS : #{@respuesta}, #{@falsas}"
     
end
preg() click to toggle source
# File lib/examen/pregunta.rb, line 40
def preg 
      "PREGUNTA : #{@enunciado}"
end
to_s() click to toggle source
# File lib/examen/pregunta.rb, line 35
def to_s
    preg +  extresp
end