this allows caching of the fact that there is nothing in the remote cache
# File lib/active_support/cache/strategy/local_cache.rb, line 88 def clear local_cache.clear if local_cache super end
# File lib/active_support/cache/strategy/local_cache.rb, line 79 def decrement(key, amount = 1) if value = super local_cache.mute { local_cache.write(key, value.to_s) } if local_cache value else nil end end
# File lib/active_support/cache/strategy/local_cache.rb, line 54 def delete(key, options = nil) local_cache.mute { local_cache.write(key, NULL) } if local_cache super end
# File lib/active_support/cache/strategy/local_cache.rb, line 59 def exist(key, options = nil) value = local_cache.read(key) if local_cache if value == NULL false elsif value true else super end end
# File lib/active_support/cache/strategy/local_cache.rb, line 70 def increment(key, amount = 1) if value = super local_cache.mute { local_cache.write(key, value.to_s) } if local_cache value else nil end end
# File lib/active_support/cache/strategy/local_cache.rb, line 15 def middleware @middleware ||= begin klass = Class.new klass.class_eval( def initialize(app) @app = app end def call(env) Thread.current[:#{thread_local_key}] = MemoryStore.new @app.call(env) ensure Thread.current[:#{thread_local_key}] = nil end, __FILE__, __LINE__ + 1) klass end end
# File lib/active_support/cache/strategy/local_cache.rb, line 34 def read(key, options = nil) value = local_cache && local_cache.read(key) if value == NULL nil elsif value.nil? value = super local_cache.mute { local_cache.write(key, value || NULL) } if local_cache value.duplicable? ? value.dup : value else # forcing the value to be immutable value.duplicable? ? value.dup : value end end
Generated with the Darkfish Rdoc Generator 2.