Money::Currency::RateStore::Memory
Inherits Money::Currency::RateStore / Enumerable / Reference / Object
Class for concurrency-safe storage of exchange rate pairs.
Used by instances of Currency::VariableExchange.
store = Money::Currency::RateStore::Memory.new
store["USD", "CAD"] = 0.98
store["USD", "CAD"] # => 0.98
# Iterates rates
store.each do |rate|
puts rate
end
Constants
INDEX_KEY_SEPARATOR = '_'
Constructors
Instance methods
transaction
Wraps block execution in a thread-safe transaction.
NOTE: Uses Mutex to synchronize data access.