Module: Erector::Caching

Included in:
Widget
Defined in:
lib/erector/caching.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



38
39
40
# File 'lib/erector/caching.rb', line 38

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#cacheObject



68
69
70
# File 'lib/erector/caching.rb', line 68

def cache
  self.class.cache
end

#should_cache?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/erector/caching.rb', line 72

def should_cache?
  cache && block.nil? && self.class.cachable?
end