Sha256: f472709c0622780c6033be7d0a1c7f2b84403ea6ee816033c650ec5e7db240c6

Contents?: true

Size: 475 Bytes

Versions: 1

Compression:

Stored size: 475 Bytes

Contents

module CacheKeeper::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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cache_keeper-0.1.0 lib/cache_keeper/caching.rb