Method: Money#to_money
- Defined in:
- lib/money/money.rb
#to_money(given_currency = nil) ⇒ self
Conversion to self
.
507 508 509 510 511 512 513 514 |
# File 'lib/money/money.rb', line 507 def to_money(given_currency = nil) given_currency = Currency.wrap(given_currency) if given_currency.nil? || self.currency == given_currency self else exchange_to(given_currency) end end |