Class: Money::Formatter::NoCents

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

Instance Method Summary collapse

Methods included from Money::Formatter

#format, #formatted, #method_missing, #rules

Constructor Details

#initialize(options) ⇒ NoCents

Returns a new instance of NoCents.



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

def class_format
  if rules
    return unit if rules[:no_cents]
  end
  return formatted
end

#next_formatterObject



15
16
17
# File 'lib/money/formatter/no_cents.rb', line 15

def next_formatter
  nil
end