module Money::RatesStore::RateRemovalSupport

Public Instance Methods

clear_rates() click to toggle source

Clears all conversion rates. Uses Mutex to synchronize data access.

@example

store = Money::RatesStore::Memory.new
store.clear_rates
# File lib/money/rates_store/rate_removal_support.rb, line 23
def clear_rates
  transaction { @index = {} }
end
remove_rate(currency_iso_from, currency_iso_to) click to toggle source

Remove a conversion rate and returns it. Uses Mutex to synchronize data access.

@param [String] currency_iso_from Currency to exchange from. @param [String] currency_iso_to Currency to exchange to.

@return [Numeric]

@example

store = Money::RatesStore::Memory.new
store.remove_rate("USD", "CAD")
store.remove_rate("CAD", "USD")
# File lib/money/rates_store/rate_removal_support.rb, line 14
def remove_rate(currency_iso_from, currency_iso_to)
  transaction { index.delete rate_key_for(currency_iso_from, currency_iso_to) }
end