Class: Money::Formatter::ThousandSeparator

Inherits:
Object
  • Object
show all
Includes:
Money::Formatter
Defined in:
lib/money/formatter/thousand_separator.rb

Instance Method Summary collapse

Methods included from Money::Formatter

#format, #formatted, #method_missing, #rules

Constructor Details

#initialize(options) ⇒ ThousandSeparator

Returns a new instance of ThousandSeparator.



4
5
6
# File 'lib/money/formatter/thousand_separator.rb', line 4

def initialize(options)
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Money::Formatter

Instance Method Details

#class_formatObject



8
9
10
11
# File 'lib/money/formatter/thousand_separator.rb', line 8

def class_format
  return add_separator if rules.has_key? :thousands_separator
  formatted
end

#next_formatterObject



13
14
15
# File 'lib/money/formatter/thousand_separator.rb', line 13

def next_formatter
  Money::Formatter::NoCents
end