Sha256: 3467cd92a7036410135cd7ef482807e61e9a424aca3896776c47651343deb43e
Contents?: true
Size: 606 Bytes
Versions: 1
Compression:
Stored size: 606 Bytes
Contents
module RestrictCache module Accessible THREAD_KEY = :restrict_cache def cache Thread.current[THREAD_KEY] ||= CacheCollection.new end def clear Thread.current[THREAD_KEY] = nil end private def method_missing(name, *args, &block) super unless cache.respond_to?(name) define_singleton_method(name) do |*a, &b| cache.public_send(name, *a, &b) end send(name, *args, &block) end def respond_to_missing?(name, include_private = false) cache.respond_to?(name) end end extend Accessible end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
restrict_cache-0.1.2 | lib/restrict_cache/accessible.rb |