Class: NumbersAndWords::Strategies::FiguresConverter::Languages::De

Inherits:
Base
  • Object
show all
Includes:
Families::Latin
Defined in:
lib/numbers_and_words/strategies/figures_converter/languages/de.rb

Instance Attribute Summary

Attributes included from Families::Base

#current_capacity, #parent_figures

Attributes inherited from Base

#decorator, #figures, #language, #options, #translations

Instance Method Summary collapse

Methods included from Families::Base

#capacity_iteration, #complex_tens, #hundreds_number_to_words, #save_parent_figures, #simple_number_to_words, #strings_logic, #words_in_capacity

Methods included from Families::Helpers

#translate

Methods inherited from Base

#initialize, #run

Constructor Details

This class inherits a constructor from NumbersAndWords::Strategies::FiguresConverter::Base

Instance Method Details

#complex_number_to_wordsObject



16
17
18
19
20
21
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 16

def complex_number_to_words
  (1..@figures.capacity_count).map { |capacity|
    @current_capacity = capacity
    capacity_iteration
  }
end

#megsObject



35
36
37
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 35

def megs
  super({:number => @figures.number_in_capacity(@current_capacity)})
end

#onesObject



23
24
25
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 23

def ones
  super(:postfix => postfix)
end

#postfixObject



27
28
29
30
31
32
33
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 27

def postfix
  case (@current_capacity ||= 0)
  when 1 then :combine
  when 0 then :default
  else :gender
  end
end


12
13
14
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 12

def print_megs_words
  [print_megs, print_other].select(&:present?).join ' '
end


8
9
10
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 8

def print_words
  1 < complex_part.count ? print_megs_words : @strings.flatten.reverse.join('')
end