Class: Linguistics::Latin::Verb::LatinVerb::TenseMethodApplicator::MutatorForVerbType::SecondBuilder
- Inherits:
-
Object
- Object
- Linguistics::Latin::Verb::LatinVerb::TenseMethodApplicator::MutatorForVerbType::SecondBuilder
- Defined in:
- lib/latinverb/tense_method_applicator/second_builder.rb
Instance Method Summary collapse
- #build! ⇒ Object
-
#initialize(verb) ⇒ SecondBuilder
constructor
A new instance of SecondBuilder.
Constructor Details
#initialize(verb) ⇒ SecondBuilder
Returns a new instance of SecondBuilder.
8 9 10 |
# File 'lib/latinverb/tense_method_applicator/second_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 94 95 96 97 98 |
# File 'lib/latinverb/tense_method_applicator/second_builder.rb', line 12 def build! @verb.instance_eval do def active_voice_indicative_mood_future_tense return TenseBlock.new( [AF_ONE_TWO_ENDINGS.collect{|x| stem + x}].flatten, { :meaning => MEANINGS[:active_voice_indicative_mood_future_tense] } ) end def active_voice_indicative_mood_imperfect_tense return TenseBlock.new( [AI_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS.collect{|x| stem + x}].flatten, { :meaning => MEANINGS[:active_voice_indicative_mood_imperfect_tense] } ) end def active_voice_indicative_mood_present_tense return TenseBlock.new( [ first_person_singular, AP_FIRST_AND_SECOND_CONJUG_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..-2] + ACTIVE_PRESENT_SUBJUNCTIVE_ENDINGS[key] elements = ['m', AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flatten!.map do |ending| asp_base + ending end TenseBlock.new( elements, { :meaning => MEANINGS[:active_voice_subjunctive_mood_present_tense] } ) end def passive_voice_indicative_mood_future_tense fp_stem = stem + "bi" standards = PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG[2..-1].map{|x| fp_stem + x} standards.pop fp_stem.sub!(/.$/,'u') elements = [stem + "b\xc5\x8dr", stem + "beris", standards, fp_stem + PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.last].flatten! TenseBlock.new( elements, { :meaning => MEANINGS[:passive_voice_indicative_mood_future_tense] } ) end def passive_voice_indicative_mood_imperfect_tense imperfect_stem = stem + "b\xc4\x81" elements = PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map{|x| imperfect_stem + x} return TenseBlock.new( elements, { :meaning => MEANINGS[:passive_voice_indicative_mood_imperfect_tense] } ) end def passive_voice_indicative_mood_present_tense local_pe = PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.clone elements = [first_person_singular.to_s + "r", local_pe[1..-1].map{|x| stem + x}].flatten! return TenseBlock.new( elements, { :meaning => MEANINGS[:passive_voice_indicative_mood_present_tense] } ) end def passive_voice_subjunctive_mood_present_tense key = verb_type.ordinal_name_key short_base = stem[0..-2] + ACTIVE_PRESENT_SUBJUNCTIVE_ENDINGS[key] elems = PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map do |ending| short_base + ending end TenseBlock.new( elems, { :meaning => MEANINGS[:passive_voice_subjunctive_mood_present_tense] } ) end end end |