class Money::Bank::SingleCurrency
means that that these mistakes don’t silently do the wrong thing.
where exchanges happen are erroneous. Using this as the default bank
it usually deals with only one currency at a time so any arithmetic
This is useful when an application uses multiple currencies but
by raising if an exchange attempts to happen.
Class to ensure client code is operating in a single currency
def exchange_with(from, to_currency, &block)
Raises a DifferentCurrencyError to remove possibility of accidentally
def exchange_with(from, to_currency, &block) raise DifferentCurrencyError, "No exchanging of currencies allowed: #{from} #{from.currency} to #{to_currency}" end