result(b=new_toplevel)
public
Executes the generated ERB code to produce a
completed template, returning the results of that code. (See ERB::new for
details on how this process can be affected by safe_level.)
b accepts a Binding object which is
used to set the context of code evaluation.
Show source
def result(b=new_toplevel)
if @safe_level
proc do
prev_safe_level = $SAFE
$SAFE = @safe_level
eval(@src, b, (@filename || '(erb)'), @lineno)
ensure
$SAFE = prev_safe_level
end.call
else
eval(@src, b, (@filename || '(erb)'), @lineno)
end
end