Skip to content

Instantly share code, notes, and snippets.

@nathanhumbert
Created January 23, 2011 20:58
Show Gist options
  • Save nathanhumbert/792436 to your computer and use it in GitHub Desktop.
Save nathanhumbert/792436 to your computer and use it in GitHub Desktop.
class CachedMetar
def self.metar(icao)
Rails.cache.fetch("cached_metar_#{icao}", :expires_in => 5.minutes) do
CurrentMetar::Metar.get_metar(icao)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment