Module: Cacheable

Defined in:
lib/cacheable.rb,
lib/cacheable/keys.rb,
lib/cacheable/caches.rb,
lib/cacheable/expiry.rb,
lib/cacheable/version.rb,
lib/cacheable/types/key_cache.rb,
lib/cacheable/types/method_cache.rb,
lib/cacheable/types/attribute_cache.rb,
lib/cacheable/types/association_cache.rb,
lib/cacheable/types/class_method_cache.rb

Defined Under Namespace

Modules: AssocationCache, AttributeCache, Caches, ClassMethodCache, Expiry, KeyCache, Keys, MethodCache

Constant Summary collapse

VERSION =
"1.3.3"

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cacheable.rb', line 7

def self.included(base)
  base.extend(Cacheable::Caches)
  base.send :include, Cacheable::Keys
  base.send :include, Cacheable::Expiry

  base.class_eval do
    def self.model_cache(&block)
      class_attribute :cached_key,
                      :cached_indices,
                      :cached_methods,
                      :cached_class_methods,
                      :cached_associations
      instance_exec &block
    end
  end
end