Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/money/core_extensions.rb
Overview
Open Numeric to add new method.
Instance Method Summary (collapse)
-
- (Money) to_money(currency = nil)
Converts this numeric into a Money object in the given currency.
Instance Method Details
- (Money) to_money(currency = nil)
Converts this numeric into a Money object in the given currency.
18 19 20 |
# File 'lib/money/core_extensions.rb', line 18 def to_money(currency = nil) Money.from_numeric(self, currency || Money.default_currency) end |