66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/erector_cache/abstract_widget.rb', line 66
def _emit_via_with_caching(parent, options={})
if self.class.key_components.blank?
_emit_via_without_caching(parent, options)
else
options = {:expire_in => @expire_in || 1.hour, :raw => true}
unless self.class.interpolations.blank?
options[:interpolate] = self.class.interpolations.inject({}) do |collection, interpolation|
collection[interpolation.first] = self.instance_variable_get("@#{interpolation.last}")
collection
end
end
cached_fragment = LAWNCHAIR.cache(cache_key, options) do
parent.capture { _emit_via_without_caching(parent, options) }
end
parent.output << cached_fragment.html_safe
end
end
|