Class: Clases::RespuestaImpostor

Inherits:
Object
  • Object
show all
Defined in:
lib/imposition/clases.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(preguntas, mensajes) ⇒ RespuestaImpostor

Returns a new instance of RespuestaImpostor.



380
381
382
383
# File 'lib/imposition/clases.rb', line 380

def initialize(preguntas,mensajes)
  @preguntas=preguntas
  @mensajes=mensajes
end

Instance Attribute Details

#mensajesObject

Returns the value of attribute mensajes.



379
380
381
# File 'lib/imposition/clases.rb', line 379

def mensajes
  @mensajes
end

#preguntasObject

Returns the value of attribute preguntas.



379
380
381
# File 'lib/imposition/clases.rb', line 379

def preguntas
  @preguntas
end

Instance Method Details

#erroresObject



393
394
395
396
397
398
399
400
401
# File 'lib/imposition/clases.rb', line 393

def errores()
  errores=[]
  @mensajes.each do |mensaje|
    if mensaje.level==3 then
      errores.push(mensaje)
    end
  end
  return errores
end

#preguntasOkObject



384
385
386
387
388
389
390
391
392
# File 'lib/imposition/clases.rb', line 384

def preguntasOk()
  todoOk=true
  @preguntas.each do |k,v|
    if v!=nil and !v.ok then
      todoOk=false
    end
  end
  return todoOk
end

#validoObject



402
403
404
# File 'lib/imposition/clases.rb', line 402

def valido()
  return errores().size==0
end