You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/lib/wechat/lib/wechat/cache_file.rb

26 lines
329 B

#coding=utf-8
#
module Wechat
class CacheFile
class << self
def cache
if defined?(Rails)
Rails.cache
else
File
end
end
def read(key)
cache.read(key) || ''
end
def write(key, val)
cache.write(key, val)
end
end
end
end