Class: Malt::Engine::Tenjin

Inherits:
Abstract show all
Defined in:
lib/malt/engines/tenjin.rb

Overview

Tenjin

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

options

:escapefunc=>'CGI.escapeHTML'

Instance Attribute Summary

Attributes inherited from Abstract

#settings

Instance Method Summary collapse

Methods inherited from Abstract

#cache?, default, #initialize, register

Constructor Details

This class inherits a constructor from Malt::Engine::Abstract

Instance Method Details

#compile(params) ⇒ Object



34
35
36
37
38
# File 'lib/malt/engines/tenjin.rb', line 34

def compile(params)
  text = params[:text]
  file = params[:file]
  intermediate(params).convert(text, file) 
end

#render(params, &yld) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/malt/engines/tenjin.rb', line 17

def render(params, &yld)
  text = params[:text]
  file = params[:file]
  data = params[:data]
  type = params[:type]
  into = params[:to] || :html

  return super(params, &yld) if type == :rbhtml && into != :html

  data = make_hash(data, &yld)
  template = intermediate(params)
  template.convert(text, file)

  template.render(data)
end