| Class | Haml::Plugin |
| In: |
lib/haml/template/plugin.rb
|
| Parent: | Haml::Util.av_template_class(:Handler) |
# File lib/haml/template/plugin.rb, line 32
32: def cache_fragment(block, name = {}, options = nil)
33: @view.fragment_for(block, name, options) do
34: eval("_hamlout.buffer", block.binding)
35: end
36: end
# File lib/haml/template/plugin.rb, line 16
16: def compile(template)
17: options = Haml::Template.options.dup
18:
19: # template is a template object in Rails >=2.1.0,
20: # a source string previously
21: if template.respond_to? :source
22: # Template has a generic identifier in Rails >=3.0.0
23: options[:filename] = template.respond_to?(:identifier) ? template.identifier : template.filename
24: source = template.source
25: else
26: source = template
27: end
28:
29: Haml::Engine.new(source, options).send(:precompiled_with_ambles, [])
30: end