Exchange rate retrieval service that uses a service from www.xmethods.com. See rubyurl.com/7uq.
Methods
Public Instance methods
This is the only method that a subclass of ExchangeRate needs to implement. This is a good example to follow.
[ show source ]
# File lib/facets/more/units.rb, line 412 def get_rate driver.getRate(country_mapping[@curr], country_mapping[base]) rescue nil end
Private Instance methods
[ show source ]
# File lib/facets/more/units.rb, line 428 def base @@base ||= data[:base] end
[ show source ]
# File lib/facets/more/units.rb, line 424 def country_mapping @@country_mapping ||= data[:mapping] end
[ show source ]
# File lib/facets/more/units.rb, line 420 def data @@data ||= YAML.load_file(File.join(Units::Config::DATADIR, 'xmethods', 'mapping.yaml')) end
[ show source ]
# File lib/facets/more/units.rb, line 432 def driver @@driver ||= SOAP::WSDLDriverFactory.new("http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl").create_rpc_driver end