Module: HasCache::Mixin::CachedMethod

Defined in:
lib/has_cache/mixin.rb

Overview

Contains the cached method for proxying calls through HasCache::Cache, on both classes and instances.

Instance Method Summary collapse

Instance Method Details

#cached(*args, &block) ⇒ Object



22
23
24
# File 'lib/has_cache/mixin.rb', line 22

def cached(*args, &block)
  HasCache::Cache.new(self, *args, &block)
end

#delete_cached(*args, &block) ⇒ Object



26
27
28
29
# File 'lib/has_cache/mixin.rb', line 26

def delete_cached(*args, &block)
  args.push(delete: true)
  HasCache::Cache.new(self, *args, &block)
end