Malt  Malt::Engine::Haml

[Validate]
Generated with RDazzle Newfish 1.4.0

Haml

Haml

Public Instance Methods

intermediate(params) click to toggle source
    # File lib/malt/engines/haml.rb, line 51
51:     def intermediate(params)
52:       text = params[:text]
53:       file = params[:file]
54:       ::Haml::Engine.new(text, :filename=>file)
55:     end
render(params, &yld) click to toggle source
    # File lib/malt/engines/haml.rb, line 12
12:     def render(params, &yld)
13:       into = params[:to]
14:       case into
15:       when :html, nil
16:         render_html(params, &yld)
17:       else
18:         super(params, &yld)
19:       end
20:     end
render_html(params, &yld) click to toggle source
    # File lib/malt/engines/haml.rb, line 23
23:     def render_html(params, &yld)
24:       text = params[:text]
25:       file = params[:file]
26:       data = params[:data]
27: 
28:       engine = intermediate(params)
29:       case data
30:       when Binding
31:         html = engine.render(make_object(data), &yld)
32:       when Hash
33:         html = engine.render(Object.new, data, &yld)
34:       else
35:         if data.respond_to?(:to_hash)
36:           data = data.to_hash
37:           html = engine.render(Object.new, data, &yld)
38:         else
39:           html = engine.render(data || Object.new, &yld)
40:         end
41:       end
42:       html
43:     end

Private Instance Methods

initialize_engine() click to toggle source

Load Haml library if not already loaded.

    # File lib/malt/engines/haml.rb, line 60
60:     def initialize_engine
61:       return if defined? ::Haml::Engine
62:       require_library 'haml'
63:     end

Disabled; run with --debug to generate this.