Class: NumbersAndWords::FiguresArray

Inherits:
Array
  • Object
show all
Includes:
ArrayExtensions::Helpers, ArrayExtensions::Validations
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::Validations

#validate_figure_array!

Methods included from ArrayExtensions::Helpers

#capacity_count, #capacity_length, #figures_array_in_capacity, #fraction_capacity, #fraction_capacity_count, #fraction_index, #fraction_sub_capacity, #hundreds, #is_a_thousand_capacity?, #number_in_capacity, #ones, #ordinal_capacity, #ordinal_index, #round_hundred?, #sub_capacity, #teens, #tens, #tens_with_ones

Methods inherited from Array

#to_figures

Instance Method Details

#local_languageObject



18
19
20
# File 'lib/numbers_and_words/helper_classes/figures_array.rb', line 18

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

#reverseObject



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

def reverse
  super.to_figures
end

#to_words(options = {}) ⇒ Object



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

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