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

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

Instance Attribute Summary

Attributes included from Families::Base

#current_capacity, #parent_figures

Attributes inherited from Base

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

Instance Method Summary collapse

Methods included from Families::Base

#complex_number_to_words, #complex_tens, #hundreds_number_to_words, #save_parent_figures, #simple_number_to_words, #strings_logic, #words_in_capacity

Methods included from Families::Helpers

#translate

Methods inherited from Base

#initialize, #run

Constructor Details

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

Instance Method Details

#capacity_iterationObject



8
9
10
# File 'lib/numbers_and_words/strategies/figures_converter/languages/es.rb', line 8

def capacity_iteration
  super.compact
end

#hundredsObject



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

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

#megsObject



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

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

#onesObject



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

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

#tens_with_onesObject



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

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



12
13
14
# File 'lib/numbers_and_words/strategies/figures_converter/languages/es.rb', line 12

def zero
  super unless maybe_remove_zero
end