Module: Verbs::Conjugator
Defined Under Namespace
Classes: Conjugations
Instance Method Summary collapse
Instance Method Details
#conjugate(infinitive, options = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/verbs/conjugator.rb', line 37 def conjugate(infinitive, = {}) tense = [:tense] || :present # present, past, future person = [:person] || :third # first, second, third plurality = [:plurality] || :singular # singular, plural diathesis = [:diathesis] || :active # active, passive mood = [:mood] || :indicative # imperative, subjunctive aspect = [:aspect] || :habitual # perfective, habitual, progressive, perfect, prospective check_for_improper_constructions(tense, person, mood) form = form_for(tense, aspect) conjugation = form.map { |e| resolve e, infinitive, tense, person, plurality, mood }.join(' ').strip if [:subject] actor = .delete(:subject) actor = subject().humanize if actor.is_a?(TrueClass) end "#{actor} #{conjugation}".strip end |
#conjugations ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/verbs/conjugator.rb', line 29 def conjugations if block_given? yield Conjugations.instance else Conjugations.instance end end |
#subject(options) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/verbs/conjugator.rb', line 59 def subject() case [[:person], [:plurality]] when [:first, :singular] 'I' when [:first, :plural] 'we' when [:second, :singular], [:second, :plural] 'you' when [:third, :singular] 'he' when [:third, :plural] 'they' end end |