2012-07-29 15:27:01 +00:00
|
|
|
module Cache
|
|
|
|
def self.delete( key )
|
|
|
|
puts 'Cache.delete' + key.to_s
|
|
|
|
Rails.cache.delete( key.to_s )
|
|
|
|
end
|
2012-07-29 15:34:30 +00:00
|
|
|
def self.write( key, data, params = {} )
|
|
|
|
if !params[:expires_in]
|
|
|
|
params[:expires_in] = 48.hours
|
|
|
|
end
|
2012-07-29 15:27:01 +00:00
|
|
|
puts 'Cache.write: ' + key.to_s
|
2012-07-29 15:34:30 +00:00
|
|
|
Rails.cache.write( key.to_s, data, params)
|
2012-07-29 15:27:01 +00:00
|
|
|
end
|
|
|
|
def self.get( key )
|
|
|
|
puts 'Cache.get: ' + key.to_s
|
|
|
|
Rails.cache.read( key.to_s )
|
|
|
|
end
|
|
|
|
end
|