jashmenn-method_cache 0.8.0.0 → 0.8.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/method_cache/proxy.rb +1 -1
- data/lib/method_cache.rb +17 -0
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/method_cache/proxy.rb
CHANGED
data/lib/method_cache.rb
CHANGED
@@ -79,6 +79,10 @@ module MethodCache
|
|
79
79
|
@default_cache ||= {}
|
80
80
|
end
|
81
81
|
|
82
|
+
def self.default_cache=(new_cache)
|
83
|
+
@default_cache = new_cache
|
84
|
+
end
|
85
|
+
|
82
86
|
def get_ancestors
|
83
87
|
ancestors = if self.respond_to?(:ancestors)
|
84
88
|
self.ancestors
|
@@ -136,6 +140,19 @@ module MethodCache
|
|
136
140
|
@disabled
|
137
141
|
end
|
138
142
|
|
143
|
+
def self.verbose(&block)
|
144
|
+
@verbose, old = true, @verbose
|
145
|
+
yield
|
146
|
+
ensure
|
147
|
+
@verbose = old
|
148
|
+
end
|
149
|
+
|
150
|
+
def self.verbose=(v)
|
151
|
+
@verbose = v
|
152
|
+
end
|
153
|
+
|
154
|
+
def self.verbose?; @verbose; end
|
155
|
+
|
139
156
|
module InvalidationMethods
|
140
157
|
def invalidate_cached_method(method_name, *args, &block)
|
141
158
|
cached_method(method_name, args).invalidate(&block)
|