Class: Ramaze::Template::Erubis
- Defined in:
- lib/ramaze/template/erubis.rb
Overview
Is responsible for compiling a template using the Erubis templating engine. Can be found at: rubyforge.org/projects/erubis
Direct Known Subclasses
Class Method Summary collapse
-
.compile(action, template) ⇒ Object
Creates an instance of ::Erubis::Eruby, sets the filename from the template and returns the instance.
-
.transform(action) ⇒ Object
Entry-point for Action#render.
Methods inherited from Template
caching_compile, reaction_or_file, render_method, result_and_file, wrap_compile
Methods included from Helper::Methods
extend_object, #helper, included
Class Method Details
.compile(action, template) ⇒ Object
Creates an instance of ::Erubis::Eruby, sets the filename from the template and returns the instance.
33 34 35 36 37 |
# File 'lib/ramaze/template/erubis.rb', line 33 def compile(action, template) eruby = ancestral_trait[:engine].new(template, ancestral_trait[:options]) eruby.init_evaluator(:filename => (action.template || __FILE__)) eruby end |
.transform(action) ⇒ Object
Entry-point for Action#render
25 26 27 28 |
# File 'lib/ramaze/template/erubis.rb', line 25 def transform action eruby = wrap_compile(action) eruby.result(action.binding) end |