Malt  Malt::Engine::Tenjin

[Validate]
Generated with RDazzle Newfish 1.4.0

Tenjin

Tenjin

  http://www.kuwata-lab.com/tenjin/

options

  :escapefunc=>'CGI.escapeHTML'

Public Instance Methods

compile(params) click to toggle source
    # File lib/malt/engines/tenjin.rb, line 34
34:     def compile(params)
35:       text = params[:text]
36:       file = params[:file]
37:       intermediate(params).convert(text, file) 
38:     end
render(params, &yld) click to toggle source
    # File lib/malt/engines/tenjin.rb, line 17
17:     def render(params, &yld)
18:       text = params[:text]
19:       file = params[:file]
20:       data = params[:data]
21:       type = params[:type]
22:       into = params[:to] || :html
23: 
24:       return super(params, &yld) if type == :rbhtml && into != :html
25: 
26:       data = make_hash(data, &yld)
27:       template = intermediate(params)
28:       template.convert(text, file)
29: 
30:       template.render(data)
31:     end

Private Instance Methods

engine_options(params) click to toggle source
    # File lib/malt/engines/tenjin.rb, line 52
52:     def engine_options(params)
53:       opts = {}
54:       opts[:escapefunc] = params[:escapefunc] || settings[:escapefunc]
55:       opts
56:     end
initialize_engine() click to toggle source

Load Liquid library if not already loaded.

    # File lib/malt/engines/tenjin.rb, line 47
47:     def initialize_engine
48:       return if defined? ::Tenjin::Engine
49:       require_library 'tenjin'
50:     end
intermediate(params) click to toggle source
    # File lib/malt/engines/tenjin.rb, line 42
42:     def intermediate(params)
43:       ::Tenjin::Template.new(nil, engine_options(params))
44:     end

Disabled; run with --debug to generate this.