class ActiveSupport::NumberHelper::NumberToDelimitedConverter

:nodoc:

def convert

def convert
  parts.join(options[:separator])
end

def delimiter_pattern

def delimiter_pattern
  options.fetch(:delimiter_pattern, DEFAULT_DELIMITER_REGEX)
end

def parts

def parts
  left, right = number.to_s.split(".")
  left.gsub!(delimiter_pattern) do |digit_to_delimit|
    "#{digit_to_delimit}#{options[:delimiter]}"
  end
  [left, right].compact
end