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