lib/cache_advance.rb in aub-cache_advance-1.0.9 vs lib/cache_advance.rb in aub-cache_advance-1.1.0
- old
+ new
@@ -1,9 +1,23 @@
-require 'cache_advance/named_cache'
require 'cache_advance/cache_set'
+require 'cache_advance/cached_key_list'
require 'cache_advance/mapper'
+require 'cache_advance/named_cache'
+require 'cache_advance/named_cache_configuration'
module CacheAdvance
class UnknownNamedCacheException < Exception; end
-
- Caches = CacheSet.new
+
+ class << self
+ attr_reader :cache_set
+ attr_accessor :caching_enabled
+ end
+
+ @cache_set = nil
+ @caching_enabled = true
+
+ def self.define_caches(store)
+ @cache_set = CacheSet.new(store)
+ yield Mapper.new(@cache_set)
+ @cache_set.setup_complete # This allows the cache set to finalize some of its configuration
+ end
end