Class: ActiveCurrency::MemoryRateStore
- Inherits:
-
Money::RatesStore::Memory
- Object
- Money::RatesStore::Memory
- ActiveCurrency::MemoryRateStore
- Defined in:
- lib/active_currency/memory_rate_store.rb
Instance Method Summary collapse
- #add_rate(from, to, value) ⇒ Object
- #currencies ⇒ Object
-
#initialize ⇒ MemoryRateStore
constructor
A new instance of MemoryRateStore.
Constructor Details
#initialize ⇒ MemoryRateStore
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 |
#currencies ⇒ Object
10 11 12 |
# File 'lib/active_currency/memory_rate_store.rb', line 10 def currencies @currencies.to_a end |