class NumbersAndWords::Strategies::FiguresConverter::Languages::Nl
Public Instance Methods
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 12 def capacity_iteration return super if @current_capacity != FiguresArray::THOUSAND_CAPACITY return [] if apply_tens_of_hundreds? return megs if figures.number_in_capacity(@current_capacity) == 1 capacity_words = words_in_capacity(@current_capacity) capacity_words.empty? ? [] : [capacity_words, megs].join end
Calls superclass method
NumbersAndWords::Strategies::FiguresConverter::Languages::Families::Base#capacity_iteration
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 8 def hundreds_number_to_words [super.reverse.join] end
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 21 def ones(*args) super({ fractional_numeral: @options.options[:fractional_numeral] }.merge(args.first || {})) end
Calls superclass method
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 29 def simple_number_to_words if @figures.only_ones && @figures.ones == 1 && !@options.options[:fractional_numeral] [@translations.t(:loose_one)] else super end end
Calls superclass method
NumbersAndWords::Strategies::FiguresConverter::Languages::Families::Base#simple_number_to_words
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 25 def tens_with_ones(*args) super({ fractional_numeral: @options.options[:fractional_numeral] }.merge(args.first || {})) end
Calls superclass method
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 37 def zero return nil if maybe_remove_zero super end
Calls superclass method
Private Instance Methods
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 59 def apply_tens_of_hundreds? @options.tens_of_hundreds.result && (1..9).cover?(figures.number_in_capacity(FiguresArray::THOUSAND_CAPACITY)) && figures.hundreds end
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 45 def maybe_remove_zero @options.remove_zero&.result end
Source
# File lib/numbers_and_words/strategies/figures_converter/languages/nl.rb, line 49 def number_without_capacity_to_words return super unless apply_tens_of_hundreds? base = save_parent_figures do @figures = @parent_figures[2, 2].to_figures simple_number_to_words end [([base, translate(:hundreds, 1)] + simple_number_to_words).join] end