module RestrictCache::Accessible

Constants

THREAD_KEY

Public Instance Methods

cache() click to toggle source
# File lib/restrict_cache/accessible.rb, line 5
def cache
  Thread.current[THREAD_KEY] ||= CacheCollection.new
end
clear() click to toggle source
# File lib/restrict_cache/accessible.rb, line 9
def clear
  Thread.current[THREAD_KEY] = nil
end

Private Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/restrict_cache/accessible.rb, line 14
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
respond_to_missing?(name, include_private = false) click to toggle source
# File lib/restrict_cache/accessible.rb, line 24
def respond_to_missing?(name, include_private = false)
  cache.respond_to?(name)
end