Sha256: deaa2c0f23bc5e449ca0c44ed79509ca3053bb47e4e6f9ead2dfbc5e1b1626f6

Contents?: true

Size: 517 Bytes

Versions: 7

Compression:

Stored size: 517 Bytes

Contents

module CacheKeeper
  module Caching
    extend ActiveSupport::Concern

    included do
      def self.caches(*method_names, **options)
        method_names.each do |method_name|
          CacheKeeper.manager.handle self, method_name, options

          # If the method is already defined, we need to hook it
          method_added method_name
        end
      end

      def self.method_added(method_name)
        super

        CacheKeeper.manager.activate_if_handling self, method_name
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cache_keeper-0.4.1 lib/cache_keeper/caching.rb
cache_keeper-0.4.0 lib/cache_keeper/caching.rb
cache_keeper-0.3.0 lib/cache_keeper/caching.rb
cache_keeper-0.2.1 lib/cache_keeper/caching.rb
cache_keeper-0.2.0 lib/cache_keeper/caching.rb
cache_keeper-0.1.2 lib/cache_keeper/caching.rb
cache_keeper-0.1.1 lib/cache_keeper/caching.rb