Parent

Included Modules

Haml::Plugin

In Rails 3.1+, template handlers don’t inherit from anything. In <= 3.0, they do. To avoid messy logic figuring this out, we just inherit from whatever the ERB handler does.

Public Class Methods

call(template) click to toggle source

In Rails 3.1+, # takes the place of #

    # File lib/haml/template/plugin.rb, line 38
38:     def self.call(template)
39:       new.compile(template)
40:     end

Public Instance Methods

cache_fragment(block, name = {}, options = nil) click to toggle source
    # File lib/haml/template/plugin.rb, line 42
42:     def cache_fragment(block, name = {}, options = nil)
43:       @view.fragment_for(block, name, options) do
44:         eval("_hamlout.buffer", block.binding)
45:       end
46:     end
compile(template) click to toggle source
    # File lib/haml/template/plugin.rb, line 21
21:     def compile(template)
22:       options = Haml::Template.options.dup
23: 
24:       # template is a template object in Rails >=2.1.0,
25:       # a source string previously
26:       if template.respond_to? :source
27:         # Template has a generic identifier in Rails >=3.0.0
28:         options[:filename] = template.respond_to?(:identifier) ? template.identifier : template.filename
29:         source = template.source
30:       else
31:         source = template
32:       end
33: 
34:       Haml::Engine.new(source, options).send(:precompiled_with_ambles, [])
35:     end
handles_encoding?() click to toggle source
    # File lib/haml/template/plugin.rb, line 19
19:     def handles_encoding?; true; end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.