Class: NumbersAndWords::Translations::Es

Inherits:
Base
  • Object
show all
Includes:
NumbersAndWords::Translations::Extensions::FractionSignificance, Families::Base
Defined in:
lib/numbers_and_words/translations/es.rb

Constant Summary

Constants inherited from Base

Base::I18N_NAMESPACE

Instance Method Summary collapse

Methods included from NumbersAndWords::Translations::Extensions::FractionSignificance

#micro, #micro_prefix, #micros

Methods included from Families::Base

#mega, #megs, #micro_separator, #teens, #tens, #union

Methods inherited from Base

#t

Instance Method Details

#hundreds(number, options = {}) ⇒ Object



27
28
29
30
# File 'lib/numbers_and_words/translations/es.rb', line 27

def hundreds(number, options = {})
  return t(%i[hundreds apocopated].join('.')) if options[:is_apocopated]
  t([:hundreds, options[:gender]].join('.'))[number]
end

#ones(number, options = {}) ⇒ Object



11
12
13
14
15
16
# File 'lib/numbers_and_words/translations/es.rb', line 11

def ones(number, options = {})
  return if options[:is_one_thousand]
  return t(%i[ones apocopated].join('.')) if number == 1 &&
                                             options[:is_apocopated]
  t([:ones, options[:gender]].join('.'))[number]
end

#tens_with_ones(numbers, options = {}) ⇒ Object



18
19
20
# File 'lib/numbers_and_words/translations/es.rb', line 18

def tens_with_ones(numbers, options = {})
  super numbers, options.merge(separator: " #{union} ")
end

#twenties_with_ones(numbers, options = {}) ⇒ Object



22
23
24
25
# File 'lib/numbers_and_words/translations/es.rb', line 22

def twenties_with_ones(numbers, options = {})
  return t(%i[twenties apocopated].join('.')) if options[:is_apocopated]
  t([:twenties, options[:gender]].join('.'))[numbers[0]]
end

#zero(_options = {}) ⇒ Object



7
8
9
# File 'lib/numbers_and_words/translations/es.rb', line 7

def zero(_options = {})
  t(%i[ones male].join('.'))[0]
end