Class: NumbersAndWords::Strategies::FiguresConverter::Languages::De
- Inherits:
-
Base
- Object
- Base
- NumbersAndWords::Strategies::FiguresConverter::Languages::De
show all
- Defined in:
- lib/numbers_and_words/strategies/figures_converter/languages/de.rb
Instance Attribute Summary
Attributes inherited from Base
#decorator, #figures, #language, #options, #translations
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #run
Instance Method Details
#complex_number_to_words ⇒ Object
14
15
16
17
18
19
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 14
def complex_number_to_words
(1..@figures.capacity_count).map do |capacity|
@current_capacity = capacity
capacity_iteration
end
end
|
#megs ⇒ Object
33
34
35
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 33
def megs
super({ number: @figures.number_in_capacity(@current_capacity) })
end
|
#ones ⇒ Object
21
22
23
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 21
def ones
super(postfix: postfix)
end
|
#postfix ⇒ Object
25
26
27
28
29
30
31
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 25
def postfix
case (@current_capacity ||= 0)
when 1 then :combine
when 0 then :default
else :gender
end
end
|
#print_megs_words ⇒ Object
10
11
12
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 10
def print_megs_words
[print_megs, print_other].reject(&:empty?).join(' ')
end
|
#print_words ⇒ Object
6
7
8
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 6
def print_words
complex_part.count > 1 ? print_megs_words : @strings.flatten.reverse.join
end
|