class

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

new

Initializes a new RateStore::Memory object.

Source

Instance methods

each

Iterates over list of Rate objects.

store.each do |rate|
  puts rate
end
Source
transaction

Wraps block execution in a thread-safe transaction. NOTE: Uses Mutex to synchronize data access.

Source