Class: NumbersAndWords::Strategies::FiguresConverter::Languages::Es

Inherits:
Base
  • Object
show all
Defined in:
lib/numbers_and_words/strategies/figures_converter/languages/es.rb

Instance Attribute Summary

Attributes inherited from Base

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

Instance Method Summary collapse

Methods inherited from Base

#initialize, #run

Constructor Details

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

Instance Method Details

#capacity_iterationObject



6
7
8
# File 'lib/numbers_and_words/strategies/figures_converter/languages/es.rb', line 6

def capacity_iteration
  super.compact
end

#hundredsObject



31
32
33
34
# File 'lib/numbers_and_words/strategies/figures_converter/languages/es.rb', line 31

def hundreds
  super({ gender: gender,
          is_apocopated: hundred_apocopated? })
end

#megsObject



36
37
38
39
# File 'lib/numbers_and_words/strategies/figures_converter/languages/es.rb', line 36

def megs
  return @translations.megs(1, number: 1) if long_scale_thousand?
  super({ number: @figures.number_in_capacity(@current_capacity) })
end

#onesObject



14
15
16
17
18
# File 'lib/numbers_and_words/strategies/figures_converter/languages/es.rb', line 14

def ones
  super({ gender: gender,
          is_one_thousand: one_thousand?,
          is_apocopated: one_apocopated? })
end

#tens_with_onesObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/numbers_and_words/strategies/figures_converter/languages/es.rb', line 20

def tens_with_ones
  if @figures.tens == 2
    @translations
      .twenties_with_ones(@figures, gender: gender,
                                    is_apocopated: one_apocopated?)
  else
    super({ gender: gender,
            is_apocopated: one_apocopated? })
  end
end

#zeroObject



10
11
12
# File 'lib/numbers_and_words/strategies/figures_converter/languages/es.rb', line 10

def zero
  super unless maybe_remove_zero
end