Class: Linguistics::Latin::Verb::LatinVerb::TenseMethodApplicator::MutatorForVerbType::FourthBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/latinverb/tense_method_applicator/fourth_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(verb) ⇒ FourthBuilder

Returns a new instance of FourthBuilder.



8
9
10
# File 'lib/latinverb/tense_method_applicator/fourth_builder.rb', line 8

def initialize(verb)
  @verb = verb
end

Instance Method Details

#build!Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/latinverb/tense_method_applicator/fourth_builder.rb', line 12

def build!
  @verb.instance_eval do
    def active_voice_indicative_mood_future_tense
      return TenseBlock.new(
        [AF_OTHER_ENDINGS.collect{|x| stem + "i" + x}].flatten,
        { :meaning => MEANINGS[:active_voice_indicative_mood_future_tense] }
        )
    end

    def active_voice_indicative_mood_imperfect_tense
      return TenseBlock.new(
        [AI_THIRD_CONJUG_PERS_ENDINGS.collect do |x|
            stem + "i" + x end ].flatten,
        { :meaning => MEANINGS[:active_voice_indicative_mood_imperfect_tense] }
        )
    end

    def active_voice_indicative_mood_present_tense
      return TenseBlock.new(
        [ first_person_singular,
                 AP_THIRDIO_CONJG_PERS_ENDINGS.collect{ |ending| stem + ending }
               ].flatten,
        { :meaning => MEANINGS[:active_voice_indicative_mood_present_tense] }
        )
    end

    def active_voice_subjunctive_mood_present_tense
      key = verb_type.ordinal_name_key
      asp_base = stem[0..-1] + ACTIVE_PRESENT_SUBJUNCTIVE_ENDINGS[key]
      collection = ['m',
         AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flatten.map do  |ending|
           asp_base + ending
      end

      TenseBlock.new(
        collection,
        { :meaning => MEANINGS[:active_voice_subjunctive_mood_present_tense] }
        )
    end

    def passive_voice_indicative_mood_future_tense
      ie_base = stem + ""
      collection =  [stem + "ia" + PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG[0],
        PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG[1..-1].map{|x| ie_base + x}].flatten
      TenseBlock.new(
        collection,
        { :meaning => MEANINGS[:passive_voice_indicative_mood_future_tense] }
        )
    end

    def passive_voice_indicative_mood_imperfect_tense
      base = stem + "iēbā"
      collection = [PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map{|x| base + x}].flatten
      return TenseBlock.new(
        collection,
        { :meaning => MEANINGS[:passive_voice_indicative_mood_imperfect_tense] }
        )
    end

    def passive_voice_indicative_mood_present_tense
      base  = stem + "ī"
      collection = [first_person_singular + "r",
        PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG[1..-2].map{|x| base + x},
        base + PASSIVE_ENDINGS_OTHER[-1]].flatten
      return TenseBlock.new(
        collection,
        { :meaning => MEANINGS[:passive_voice_indicative_mood_present_tense] }
        )
    end

    def passive_voice_subjunctive_mood_present_tense
      subjunctive_stem = stem + ""
      collection = PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map do |ending|
        subjunctive_stem + ending
      end
      TenseBlock.new(
        collection,
        { :meaning => MEANINGS[:passive_voice_subjunctive_mood_present_tense] }
        )
    end
  end
end