Method: Brine::MustacheExpanding::BrineTemplate#expand

Defined in:
lib/brine/mustache_expanding.rb

#expand(binding) ⇒ String

Expand the template using the provided bindings.

Parameters:

  • binding (Hash)

    Provide bound values to use within the template.

Returns:

  • (String)

    Return the contents of this template applied against ‘binding`.



55
56
57
58
59
60
61
62
# File 'lib/brine/mustache_expanding.rb', line 55

def expand(binding)
  begin
    context.push(binding)
    render
  ensure
    context.pop
  end
end