Class: Respanol::Examen::ConjugacionExamen

Inherits:
ExamenBase
  • Object
show all
Defined in:
lib/respanol/examenes/conjugacion_examen.rb

Constant Summary

Constants inherited from ExamenBase

ExamenBase::GAZA_CONDE

Instance Method Summary collapse

Methods inherited from ExamenBase

#decir_que_no, emparejar?, #emparejar?, #ensayar, #felicitar, #gaza, gaza, #optener, #pedir

Methods included from Impresion

included

Constructor Details

#initialize(verbos = nil) ⇒ ConjugacionExamen

Returns a new instance of ConjugacionExamen.



4
5
6
# File 'lib/respanol/examenes/conjugacion_examen.rb', line 4

def initialize(verbos = nil)
  @verbos = Array(verbos)
end

Instance Method Details

#conjugado(klase = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/respanol/examenes/conjugacion_examen.rb', line 8

def conjugado(klase = nil)
  klases = @verbos
  klases = klases | Array(klase) unless klase.nil?
  kl = klases.sample
  pro = Pronombre.todos.sample
  prefijo(kl)
  ensayar("#{pro} ") do |v|
    kl::CONJUGACION.find_index(v) == Pronombre.verbo_indice(pro)
  end
end