class NumbersAndWords::Wrappers::Integer

Attributes

number[RW]

Public Class Methods

new(number) click to toggle source
# File lib/numbers_and_words/wrappers/integer.rb, line 8
def initialize(number)
  @number = number
end

Public Instance Methods

to_words(options = {}) click to toggle source
# File lib/numbers_and_words/wrappers/integer.rb, line 12
def to_words(options = {})
  to_figures_array.to_words options
end

Private Instance Methods

to_figures_array() click to toggle source
# File lib/numbers_and_words/wrappers/integer.rb, line 18
def to_figures_array
  number.to_s.chars.map(&:to_i).to_figures
end