Class: LLT::VerbBuilder

Inherits:
FormBuilder show all
Defined in:
lib/llt/form_builder/verb_builder.rb

Constant Summary

Constants inherited from FormBuilder

FormBuilder::VERSION

Instance Attribute Summary

Attributes inherited from FormBuilder

#impersonalium

Instance Method Summary collapse

Methods inherited from FormBuilder

#attributes_by_index, build, #compute, #corrections, #cross_indices, #default_args, #downcase_all_stems, #endings, #endings_attributes, #endings_container, #endings_lookup, #endings_path, #extensions_and_other_signs, #form_class, #indices_by_ending, #init_keys, #initialize, #keep_given_value, lookup_class, #lookup_indices, #needs_validation?, #new_form, #prefix, #reverse_lookup, #stays_capitalized, #stem_copy, #valid?, #validation_rule, #validations, validations, #value_as_index

Constructor Details

This class inherits a constructor from LLT::FormBuilder

Instance Method Details

#contractionObject



29
30
31
# File 'lib/llt/form_builder/verb_builder.rb', line 29

def contraction
  @options[:contraction]
end

#endings_namespaceObject



33
34
35
# File 'lib/llt/form_builder/verb_builder.rb', line 33

def endings_namespace
  super::Verb
end

#genus_indexObject



13
14
15
# File 'lib/llt/form_builder/verb_builder.rb', line 13

def genus_index
  @deponens ? [6] : [0, 6]
end

#new_form_through_index(ending, i) ⇒ Object



24
25
26
27
# File 'lib/llt/form_builder/verb_builder.rb', line 24

def new_form_through_index(ending, i)
  p, n, g, m, t = attributes_by_index(i)
  new_form(ending: ending, persona: p, numerus: n, tempus: t, modus: m, genus: g, index: i)
end

#persona_indexObject



9
10
11
# File 'lib/llt/form_builder/verb_builder.rb', line 9

def persona_index
  @impersonalium ? [nil, nil, 2] : [0, 1, 2]
end

#regular_formsObject



17
18
19
20
21
22
# File 'lib/llt/form_builder/verb_builder.rb', line 17

def regular_forms
  endings.each_with_index.map do |ending, i|
    next unless (@lookup_indices.include?(i) && ending) # nil values in verb endings are escaped
    new_form_through_index(ending, i)
  end.compact
end