Class: LLT::AdverbBuilder
- Inherits:
-
AdjectiveBuilder
- Object
- FormBuilder
- DeclinableBuilder
- AdjectiveBuilder
- LLT::AdverbBuilder
- Defined in:
- lib/llt/form_builder/adverb_builder.rb
Constant Summary
Constants inherited from FormBuilder
Instance Attribute Summary
Attributes inherited from DeclinableBuilder
Attributes inherited from FormBuilder
Instance Method Summary collapse
- #comparativus_extraction(stem, args) ⇒ Object
- #compute ⇒ Object
-
#initialize(stem) ⇒ AdverbBuilder
constructor
A new instance of AdverbBuilder.
Methods inherited from AdjectiveBuilder
#comp_sign, #corrections, #er_nominative_possible?, #extract_comparison_sign, #init_keys, #marker, #markers_path, #nominatives, #pronominal_declension?, #regular_o_declension?
Methods inherited from DeclinableBuilder
#additional_forms, #casus_numerus_sexus_by_index, #endings_lookup, #er_nominative_possible?, #extended_special_forms, #index_of_ending, #indices, #irregulars_with_nominative, #new_attributes, #new_form_through_index, #new_special_form, #o_declension_on_ius?, #pronominal_declension?, #proper_vocative, #regular_forms, #regular_o_declension?, #special_ending, #with_replacements
Methods inherited from FormBuilder
#attributes_by_index, build, #corrections, #cross_indices, #default_args, #downcase_all_stems, #endings, #endings_attributes, #endings_container, #endings_lookup, #endings_namespace, #endings_path, #extensions_and_other_signs, #form_class, #indices_by_ending, #init_keys, #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
#initialize(stem) ⇒ AdverbBuilder
Returns a new instance of AdverbBuilder.
6 7 8 9 10 11 |
# File 'lib/llt/form_builder/adverb_builder.rb', line 6 def initialize(stem) extract_normalized_args!(stem) @options = stem[:options] || {} @validate = @options.any? downcase_all_stems end |
Instance Method Details
#comparativus_extraction(stem, args) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/llt/form_builder/adverb_builder.rb', line 18 def comparativus_extraction(stem, args) stem.match(/(#{marker(:IUS)})$/) new_stem = stem.chomp($1) # do not use chomp! as other forms will get severed raise "No comparison sign for comparative present" if new_stem == stem [new_stem, $1] end |
#compute ⇒ Object
13 14 15 16 |
# File 'lib/llt/form_builder/adverb_builder.rb', line 13 def compute # endings is not an array in this case, just a plain string new_form(ending: endings) end |