Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/money/core_extensions.rb
Overview
Open Numeric
to add new method.
Instance Method Summary collapse
-
#to_money(currency = nil) ⇒ Money
Converts this numeric into a
Money
object in the givencurrency
.
Instance Method Details
#to_money(currency = nil) ⇒ Money
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 |