module Cacheable::Keys::ClassKeys

Public Instance Methods

all_attribute_cache_key(attribute, value) click to toggle source
# File lib/cacheable/keys.rb, line 15
def all_attribute_cache_key(attribute, value)
  "#{self.base_class.name.tableize}/attribute/#{attribute}/all/#{URI.escape(value.to_s)}"
end
attribute_cache_key(attribute, value) click to toggle source
# File lib/cacheable/keys.rb, line 11
def attribute_cache_key(attribute, value)
  "#{self.base_class.name.tableize}/attribute/#{attribute}/#{URI.escape(value.to_s)}"
end
class_method_cache_key(meth, *args) click to toggle source
# File lib/cacheable/keys.rb, line 19
def class_method_cache_key(meth, *args)
  key = "#{self.base_class.name.tableize}/class_method/#{meth}"
  args.flatten!
  key += "/#{args.join('+')}" if args.any?
  return key
end
instance_cache_key(param) click to toggle source
# File lib/cacheable/keys.rb, line 26
def instance_cache_key(param)
  "#{self.base_class.name.tableize}/#{param}"
end