A SpotRate instance will by default use the GoogleCurrencyConverter if no other currency converters are registered:
require 'spot-rate' puts Time.now # => 2013-05-01 18:34:09 -0700 puts SpotRate.new(:from_currency => 'USD', :to_currency => 'CAD').spot_rate # => 1.01689986 # or, more concisely: puts SpotRate['USD' => 'CAD'] # => 1.01689986
If you'd like to register your own currency converter, use the .register_currency_converter method:
require 'spot-rate' class MyRandomCurrencyConverter def initialize from_currency, to_currency @from_currency = from_currency @to_currency = to_currency end def spot_rate rand # yolo end end SpotRate.register_currency_converter(:random_converter, MyRandomCurrencyConverter) spot_rate = SpotRate.new(:from_currency => 'USD', :to_currency => 'CAD') puts spot_rate.use(:random_converter).spot_rate # => 0.5363022464905228 puts spot_rate.spot_rate # will go back to using the pre-packaged default Google converter # => 1.01689986