Class: NumbersAndWords::Strategies::FiguresConverter::Languages::PtBr
- Inherits:
-
Base
- Object
- Base
- NumbersAndWords::Strategies::FiguresConverter::Languages::PtBr
show all
- Defined in:
- lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb
Instance Attribute Summary
Attributes inherited from Base
#figures, #options, #strategy, #strings, #translations
#current_capacity, #parent_figures
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #print_words
#complex_tens, #hundreds_number_to_words, #save_parent_figures, #simple_number_to_words, #strings_logic, #words_in_capacity
#translate
Instance Method Details
#capacity_iteration ⇒ Object
26
27
28
29
30
31
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 26
def capacity_iteration
words = []
capacity_words = words_in_capacity(current_capacity)
words.push(megs) unless capacity_words.empty? || (capacity_words.empty? && figures[0] == 1)
words + capacity_words
end
|
#complex_number_to_words ⇒ Object
22
23
24
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 22
def complex_number_to_words
super.compact
end
|
#hundreds ⇒ Object
37
38
39
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 37
def hundreds
super(internal_options.merge(is_hundred: hundred?, is_one_hundred: one_hundred?, gender:))
end
|
#megs ⇒ Object
41
42
43
44
45
46
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 41
def megs
super(internal_options.merge(number: @figures.number_in_capacity(@current_capacity),
is_opaque: opaque?,
is_without_connector: without_connector?,
is_with_comma: with_comma?))
end
|
#ones ⇒ Object
33
34
35
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 33
def ones
super(internal_options.merge(is_one_thousand: one_thousand?))
end
|
#words ⇒ Object
18
19
20
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 18
def words
super.strip
end
|
#zero ⇒ Object
14
15
16
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 14
def zero
super unless maybe_remove_zero
end
|