#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

