# File lib/erector/caching.rb, line 38 def self.included(base) base.extend ClassMethods end
# File lib/erector/caching.rb, line 68 def cache self.class.cache end
# File lib/erector/caching.rb, line 72 def should_cache? cache && block.nil? && self.class.cachable? end
# File lib/erector/caching.rb, line 77 def _emit(options = {}) if should_cache? cache[self.class, assigns, options[:content_method_name]] ||= super else super end end
# File lib/erector/caching.rb, line 85 def _emit_via(parent, options = {}) if should_cache? parent.output << cache[self.class, assigns, options[:content_method_name]] ||= parent.capture { super } parent.output.widgets << self.class # todo: test!!! else super end end