Haml::Engine#render

Parsed documentation:
View on GitHub
Processes the template and returns the result as a string.

`scope` is the context in which the template is evaluated.
If it's a `Binding`, Haml uses it as the second argument to `Kernel#eval`;
otherwise, Haml just uses its `#instance_eval` context.

Note that Haml modifies the evaluation context
(either the scope object or the `self` object of the scope binding).
It extends {Haml::Helpers}, and various instance variables are set
(all prefixed with `haml_`).
For example:

    s = "foobar"
    Haml::Engine.new("%p= upcase").render(s) #=> "<p>FOOBAR</p>"

    # s now extends Haml::Helpers
    s.respond_to?(:html_attrs) #=> true

`locals` is a hash of local variables to make available to the template.
For example:

    Haml::Engine.new("%p= foo").render(Object.new, :foo => "Hello, world!") #=> "<p>Hello, world!</p>"

If a block is passed to render,
that block is run when `yield` is called
within the template.

Due to some Ruby quirks,
if `scope` is a `Binding` object and a block is given,
the evaluation context may not be quite what the user expects.
In particular, it's equivalent to passing `eval("self", scope)` as `scope`.
This won't have an effect in most cases,
but if you're relying on local variables defined in the context of `scope`,
they won't work.

@param scope [Binding, Object] The context in which the template is evaluated
@param locals [{Symbol => Object}] Local variables that will be made available
  to the template
@param block [#to_proc] A block that can be yielded to within the template
@return [String] The rendered template
No suggestions.
Please help! Open an issue on GitHub if this assessment is incorrect.