Class: ActiveCurrency::MemoryRateStore

Inherits:
Money::RatesStore::Memory
  • Object
show all
Defined in:
lib/active_currency/memory_rate_store.rb

Instance Method Summary collapse

Constructor Details

#initializeMemoryRateStore

Returns a new instance of MemoryRateStore.



5
6
7
8
# File 'lib/active_currency/memory_rate_store.rb', line 5

def initialize(**)
  @currencies = Set.new
  super
end

Instance Method Details

#add_rate(from, to, value) ⇒ Object



14
15
16
17
18
# File 'lib/active_currency/memory_rate_store.rb', line 14

def add_rate(from, to, value)
  @currencies << from
  @currencies << to
  super
end

#currenciesObject



10
11
12
# File 'lib/active_currency/memory_rate_store.rb', line 10

def currencies
  @currencies.to_a
end