From: ssmoot@... Date: 2005-09-20T06:06:39+09:00 Subject: Re: Units for Ruby Small caching problem: The xmethods.net method seems to provide realtime data. Which is cool, but the data is being cached by symbol names, so: 10.usd.to_yen returns 10*x and 10.usd.to_jpy returns 10*y Even though they should technically return the same value. I doubt it'd affect anyone's actual code since you're likely to use one or the other, not both, but still... modifying the code to use country names instead looks like this: def lookup_currency(from, to) from = @@currency_countries[from] to = @@currency_countries[to] cache_key = :"#{from}_to_#{to}" @@currency_rates[cache_key] ||= @@currency_converter.getRate(from, to) return @@currency_rates[cache_key] end Problem solved. Thanks for the code btw. :)