Malt  Malt::Format::RHTML

[Validate]
Generated with RDazzle Newfish 1.4.0

RHTML

RHTML is a variant of Erb files which are limited to conversion to HTML.

Public Instance Methods

html(data=nil, &yld) click to toggle source
    # File lib/malt/formats/rhtml.rb, line 31
31:     def html(data=nil, &yld)
32:       render_engine.render(:text=>text, :file=>file, :format=>:html)
33:     end
precompile(*) click to toggle source
rb(*) click to toggle source

RHTML templates can be “pre-compiled” into Ruby templates.

    # File lib/malt/formats/rhtml.rb, line 14
14:     def rb(*)
15:       render_engine.compile(:text=>text, :file=>file)
16:     end
to_html(data=nil, &yld) click to toggle source
    # File lib/malt/formats/rhtml.rb, line 36
36:     def to_html(data=nil, &yld)
37:       text = html(data, &yld)
38:       opts = options.merge(:text=>text, :file=>refile(:html), :type=>:html)
39:       HTML.new(opts)
40:     end
to_rb(*) click to toggle source

RHTML templates can be “pre-compiled” into Ruby templates.

    # File lib/malt/formats/rhtml.rb, line 19
19:     def to_rb(*)
20:       text = rb
21:       Ruby.new(:text=>text, :file=>refile(:rb), :type=>:rb)
22:     end
Also aliased as: to_ruby, precompile
to_ruby(*) click to toggle source

Private Instance Methods

render_engine() click to toggle source
    # File lib/malt/formats/rhtml.rb, line 72
72:     def render_engine
73:       @render_engine ||= (
74:         case engine
75:         when :erubis
76:           Malt::Engine::Erubis.new(options)
77:         else
78:           Malt::Engine::Erb.new(options)
79:         end
80:       )
81:     end

Disabled; run with --debug to generate this.