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
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 do |capacity|
@current_capacity = capacity
capacity_iteration
end
end
|
#megs ⇒ Object
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
|
#ones ⇒ Object
23
24
25
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 23
def ones
super(postfix:)
end
|
#postfix ⇒ Object
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
|
#print_megs_words ⇒ Object
12
13
14
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 12
def print_megs_words
[print_megs, print_other].reject(&:empty?).join(' ')
end
|
#print_words ⇒ Object
8
9
10
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/de.rb', line 8
def print_words
complex_part.count > 1 ? print_megs_words : @strings.flatten.reverse.join
end
|