Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def self.cached_deliveries
if File.exists?(DELIVERIES_CACHE_PATH) == false || File.zero?(DELIVERIES_CACHE_PATH) == true
return []
else
File.open(DELIVERIES_CACHE_PATH,'r') do |f|
Marshal.load(f)
end
end
end
def self.cached_deliveries
begin
File.open(DELIVERIES_CACHE_PATH,'r') do |f|
Marshal.load(f)
end
rescue
[]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment