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