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
24
25
26
27
28
29
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 24
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
20
21
22
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 20
def complex_number_to_words
super.reject(&:nil?)
end
|
#hundreds ⇒ Object
35
36
37
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 35
def hundreds
super(internal_options.merge(is_hundred: hundred?, is_one_hundred: one_hundred?, gender: gender))
end
|
#megs ⇒ Object
39
40
41
42
43
44
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 39
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
31
32
33
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 31
def ones
super internal_options.merge(is_one_thousand: one_thousand?)
end
|
#words ⇒ Object
16
17
18
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 16
def words
super.strip
end
|
#zero ⇒ Object
12
13
14
|
# File 'lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb', line 12
def zero
super unless maybe_remove_zero
end
|