Module: CachedResource::Model::ClassMethods

Defined in:
lib/cached_resource/cached_resource.rb

Instance Method Summary collapse

Instance Method Details

#inherited(child) ⇒ Object

Copy a superclass’s cached resource configuration if it’s defined. Unfortunately, this means that any subclass that wants an independent configuration will need to execute: self.cached_resource = CachedResource::Configuration.new(options={})



32
33
34
35
# File 'lib/cached_resource/cached_resource.rb', line 32

def inherited(child)
  child.cached_resource = self.cached_resource if defined?(@cached_resource)
  super
end