Class: NumbersAndWords::FiguresArray

Inherits:
Array
  • Object
show all
Includes:
ArrayExtensions::Helpers
Defined in:
lib/numbers_and_words/helper_classes/figures_array.rb

Constant Summary

Constants included from ArrayExtensions::Helpers

ArrayExtensions::Helpers::FIGURES_IN_CAPACITY, ArrayExtensions::Helpers::MICRO_CAPACITY_SHIFT, ArrayExtensions::Helpers::ONES_SHIFT, ArrayExtensions::Helpers::THOUSAND_CAPACITY

Instance Method Summary collapse

Methods included from ArrayExtensions::Helpers

#capacity_count, #capacity_length, #figures_array_in_capacity, #figures_array_under_capacity, #fraction_capacity, #fraction_capacity_count, #fraction_sub_capacity, #hundreds, #number_in_capacity, #number_under_capacity, #ones, #opaque?, #ordinal_capacity, #ordinal_index, #round_hundred?, #sub_capacity, #teens, #tens, #tens_with_ones

Methods inherited from Array

#to_figures

Instance Method Details

#local_languageObject



15
16
17
# File 'lib/numbers_and_words/helper_classes/figures_array.rb', line 15

def local_language
  ::I18n.with_locale(I18n.local_language) { yield }
end

#reverseObject



11
12
13
# File 'lib/numbers_and_words/helper_classes/figures_array.rb', line 11

def reverse
  super.to_figures
end

#to_words(options = {}) ⇒ Object



7
8
9
# File 'lib/numbers_and_words/helper_classes/figures_array.rb', line 7

def to_words(options = {})
  local_language { Strategies.figures_converter.new(self, options).run }
end