module Grass::Cache::ClassMethods

Public Instance Methods

data_cache_keys() click to toggle source
# File lib/grass/cache.rb, line 6
def data_cache_keys 
  @@data_cache_keys ||= %i(language_info country_info params http_host request_path)
end
data_cache_keys=(keys) click to toggle source
# File lib/grass/cache.rb, line 10
def data_cache_keys= keys
  @@data_cache_keys = keys
end
generate_cachekey(key_fullpath, data) click to toggle source
# File lib/grass/cache.rb, line 18
def generate_cachekey key_fullpath, data
  Digest::MD5.hexdigest("#{key_fullpath}_#{data.select{|k,v| self.data_cache_keys.include?(k)}}")      
end
read_cache(cache_key) click to toggle source
# File lib/grass/cache.rb, line 14
def read_cache cache_key
  JSON.load(Grass.cache.get(cache_key))
end