Class: Haml::Plugin
- Includes:
- ActionView::TemplateHandlers::Compilable
- Defined in:
- lib/haml/template/plugin.rb
Instance Method Summary collapse
Instance Method Details
#cache_fragment(block, name = {}, options = nil) ⇒ Object
24 25 26 27 28 |
# File 'lib/haml/template/plugin.rb', line 24 def cache_fragment(block, name = {}, = nil) @view.fragment_for(block, name, ) do eval("_hamlout.buffer", block.binding) end end |
#compile(template) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/haml/template/plugin.rb', line 9 def compile(template) = Haml::Template..dup # template is a template object in Rails >=2.1.0, # a source string previously if template.respond_to? :source [:filename] = template.filename source = template.source else source = template end Haml::Engine.new(source, ).send(:precompiled_with_ambles, []) end |