Module: BennyCache::ClassMethods

Defined in:
lib/benny_cache/related.rb

Instance Method Summary collapse

Instance Method Details



46
47
48
49
# File 'lib/benny_cache/related.rb', line 46

def benny_related_index(*options)
  index_keys = options.map {|idx| idx.is_a?(Array) ? idx.map{ |jdx| "#{jdx.to_s}/:#{jdx.to_s}"}.join("/") : idx }
  self.class_variable_get(:@@benny_related_indexes).push(*index_keys)
end


51
52
53
54
# File 'lib/benny_cache/related.rb', line 51

def benny_related_method(*options)
  index_keys = options.map {|idx| idx.is_a?(Array) ? idx.map{ |jdx| "#{jdx.to_s}/:#{jdx.to_s}"}.join("/") : idx }
  self.class_variable_get(:@@benny_related_methods).push(*index_keys)
end