Module: Garner::Cache::Binding

Included in:
Mixins::ActiveRecord::Base, Mixins::Mongoid::Document, Mixins::Mongoid::Identity
Defined in:
lib/garner/cache/binding.rb

Instance Method Summary collapse

Instance Method Details

#garner_cache_keyString

Apply the cache key strategy to this binding.



26
27
28
# File 'lib/garner/cache/binding.rb', line 26

def garner_cache_key
  key_strategy.apply(self)
end

#invalidate_garner_cachesBoolean

Apply the invalidation strategy to this binding.



40
41
42
43
# File 'lib/garner/cache/binding.rb', line 40

def invalidate_garner_caches
  invalidation_strategy.apply(self)
  true
end

#invalidation_strategyObject

Override this method to use a custom invalidation strategy.



33
34
35
# File 'lib/garner/cache/binding.rb', line 33

def invalidation_strategy
  Garner.config.binding_invalidation_strategy
end

#key_strategyObject

Override this method to use a custom key strategy.



19
20
21
# File 'lib/garner/cache/binding.rb', line 19

def key_strategy
  Garner.config.binding_key_strategy
end