Class: YDIM::CurrencyConverter
Constant Summary
collapse
- ODBA_SERIALIZABLE =
['@conversions']
Instance Method Summary
collapse
#convert, #initialize
Instance Method Details
#known_currencies ⇒ Object
20
21
22
|
# File 'lib/ydim/currency_converter.rb', line 20
def known_currencies
@conversions.keys.collect { |origin, target| origin }.uniq.size
end
|
#store(origin, target, rate) ⇒ Object
23
24
25
26
|
# File 'lib/ydim/currency_converter.rb', line 23
def store(origin, target, rate)
@conversions.store([target, origin], 1.0/rate)
@conversions.store([origin, target], rate)
end
|