RubyMoney/eu_central_bank — pull request #15 by laurens (2013-08-15 18:04:58+00:00)
Title: Add rates_updated_at attribute containing the date set in the XML file

Saves the modification date of the rates.

Can be used for a cache expiry implementation like so:

@bank = EuCentralBank.new

cache = "tmp/ecb_exchange_rates.xml"

begin
@bank.update_rates(cache)
rescue
end

if !@bank.rates_updated_at || @bank.rates_updated_at < Time.now - 1.days
@bank.update_rates
@bank.save_rates(cache)
end