Van::Units::Converter::ExchangeRate::XMethods

Exchange rate retrieval service that uses a service from www.xmethods.com. See rubyurl.com/7uq.

Public Instance Methods

get_rate() click to toggle source

This is the only method that a subclass of ExchangeRate needs to implement. This is a good example to follow.

     # File lib/van/units/currency.rb, line 96
 96:         def get_rate
 97:           driver.getRate(country_mapping[@curr], country_mapping[base])
 98:         rescue
 99:           p $!
100:           puts $!.backtrace
101:           nil
102:         end

Private Instance Methods

base() click to toggle source
     # File lib/van/units/currency.rb, line 114
114:         def base
115:           @@base ||= data[:base]
116:         end
country_mapping() click to toggle source
     # File lib/van/units/currency.rb, line 110
110:         def country_mapping
111:           @@country_mapping ||= data[:mapping]
112:         end
data() click to toggle source
     # File lib/van/units/currency.rb, line 106
106:         def data
107:           @@data ||= eval(File.read(File.join(Units::Config::CONFIGDIR, 'xmethods', 'mapping.rb')))
108:         end
driver() click to toggle source
     # File lib/van/units/currency.rb, line 118
118:         def driver
119:           @@driver ||= SOAP::WSDLDriverFactory.new("http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl").create_rpc_driver
120:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.