class Money

def exchange_to(other_currency, &rounding_method)

Returns:
  • (Money) -

Other tags:
    Yieldreturn: -

Other tags:
    Yieldparam: n - The resulting float after exchanging one currency for

Other tags:
    Yield: - Optional block to use when rounding after exchanging one currency

Parameters:
  • other_currency (Currency, String, Symbol) -- Currency to exchange to.
def exchange_to(other_currency, &rounding_method)
  other_currency = Currency.wrap(other_currency)
  if self.currency == other_currency
    self
  else
    @bank.exchange_with(self, other_currency, &rounding_method)
  end
end