class CoinSync::Config::CurrencyConversionOptions
Constants
- DEFAULT_CURRENCY_CONVERTER
Public Class Methods
new(options)
click to toggle source
Calls superclass method
# File lib/coinsync/config.rb, line 96 def initialize(options) super if options['using'] self.currency_converter_name = options['using'].to_sym else self.currency_converter_name = DEFAULT_CURRENCY_CONVERTER end if options['to'] self.currency = FiatCurrency.new(options['to'].upcase) else raise "'convert_currency' requires a 'to' field with a currency code" end end
Public Instance Methods
currency_converter()
click to toggle source
# File lib/coinsync/config.rb, line 112 def currency_converter currency_converter_class = CurrencyConverters.registered[currency_converter_name] if currency_converter_class currency_converter_class.new(self) else raise "Unknown currency converter: #{currency_converter_name}" end end