Class: Malt::Formats::Tenjin
- Inherits:
-
AbstractTemplate
- Object
- AbstractTemplate
- Malt::Formats::Tenjin
- Defined in:
- lib/malt/formats/tenjin.rb
Overview
Tenjin
http://www.kuwata-lab.com/tenjin/
Instance Method Summary collapse
- #html ⇒ Object
- #rb ⇒ Object
- #to_html(data, &yld) ⇒ Object
-
#to_rb ⇒ Object
(also: #to_ruby)
Erb templates can be “precompiled” into Ruby templates.
Instance Method Details
#html ⇒ Object
28 29 30 |
# File 'lib/malt/formats/tenjin.rb', line 28 def html render(:html, data, &yld) end |
#rb ⇒ Object
15 16 17 |
# File 'lib/malt/formats/tenjin.rb', line 15 def rb render_engine.compile(text, file) end |
#to_html(data, &yld) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/malt/formats/tenjin.rb', line 33 def to_html(data, &yld) new_text = render(:html, data, &yld) new_file = refile(:html) = .merge(:text=>new_text, :file=>new_file, :type=>:html) HTML.new() end |
#to_rb ⇒ Object Also known as: to_ruby
Erb templates can be “precompiled” into Ruby templates.
20 21 22 23 |
# File 'lib/malt/formats/tenjin.rb', line 20 def to_rb text = rb Ruby.new(:text=>text, :file=>refile(:rb), :type=>:rb) end |