Sha256: 08237a6946023e6ba93351df67850112bf7de620f6c4b3f5f6792430b9a80d1a

Contents?: true

Size: 694 Bytes

Versions: 21

Compression:

Stored size: 694 Bytes

Contents

require 'moneta'
require 'active_support/inflector'

module CanTango
  class Ability
    class Cache
      class MonetaCache
        # one cache store is shared for all store instances (w different names)
        attr_reader :store

        # for a YamlStore, the name is the name of the yml file
        def initialize name, options = {}
          super
          @store = CanTango::Cache::MonetaCache.instance
          @store.configure_with options
        end

        def load key
          store.load! key
        end

        def save key, rules
          store.save! key, rules
        end

        def invalidate! key
          store.delete key
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.9.4.6 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.9.4.5 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.9.4.3 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.9.4.2 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.9.4.1 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.9.4 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.9.3.2 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.9.5 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.9.4 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.9.3 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.9.2 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.9.1 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.9 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.8.1 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.8 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.7 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.6.2 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.6.1 lib/cantango/ability/cache/moneta_cache.rb
cantango-0.8.6 lib/cantango/ability/cache/moneta_cache.rb