Class: Money::Formatter::DecimalMark

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

Instance Method Summary collapse

Methods included from Money::Formatter

#format, #formatted, #method_missing, #rules

Constructor Details

#initialize(options) ⇒ DecimalMark

Returns a new instance of DecimalMark.



4
5
6
# File 'lib/money/formatter/decimal_mark.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
12
# File 'lib/money/formatter/decimal_mark.rb', line 8

def class_format
  return formatted if rule_decimal_mark === false
  return add_mark if cents > 0
  return formatted
end

#next_formatterObject



14
15
16
# File 'lib/money/formatter/decimal_mark.rb', line 14

def next_formatter
  Money::Formatter::DisplayFree
end