class RestrictCache::Base
Public Class Methods
cache_key()
click to toggle source
# File lib/restrict_cache/base.rb, line 10 def cache_key self.name end
instance()
click to toggle source
# File lib/restrict_cache/base.rb, line 4 def instance _cache = RestrictCache.custom_cache.contents(cache_key) _cache = RestrictCache.custom_cache.add(self.new) unless _cache _cache end
Private Class Methods
method_missing(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/restrict_cache/base.rb, line 15 def method_missing(name, *args, &block) super unless instance.respond_to?(name) define_singleton_method(name) do |*a, &b| instance.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/base.rb, line 25 def respond_to_missing?(name, include_private = false) instance.respond_to?(name) end