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_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

#figures_array_in_capacity(capacity) ⇒ Object


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

def figures_array_in_capacity(capacity)
  super.to_figures
end

#local_language(&block) ⇒ Object


21
22
23
# File 'lib/numbers_and_words/helper_classes/figures_array.rb', line 21

def local_language(&block)
  ::I18n.with_locale(I18n.local_language, &block)
end

#reverseObject


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

def reverse
  super.to_figures
end

#to_words(options = {}) ⇒ Object


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

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