13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/erector/rails/template_handlers/ert_handler.rb', line 13
def compile(template)
[
"extend ::Erector::Mixin",
"@output_buffer = ''",
"memoized_instance_variables = instance_variables.inject({}) do |all, instance_variable|",
" all[instance_variable] = instance_variable_get(instance_variable)",
" all",
"end",
"r = (controller.ert_template_base_class || ::Erector).inline do",
" memoized_instance_variables.each do |instance_variable, value|",
" instance_variable_set(instance_variable, value)",
" end",
template.source,
"end",
"r.to_html",
].join("; ")
end
|