Module: Sinatra::Bldr::Helpers

Defined in:
lib/sinatra/bldr.rb

Instance Method Summary collapse

Instance Method Details

#bldr(template, opts = {}, &block) ⇒ Object

Parameters:

  • template (String, Symbol)

    the template to render Can be a relative file location or a string template. The template may also be passed in as the block argument to this method, in which case, template argument is nil.

  • opts (Hash) (defaults to: {})

    a hash of options

  • (Hash)

    a customizable set of options

Options Hash (opts):

  • :locals (Hash)

    a hash of local variables to be used in the template



16
17
18
19
20
# File 'lib/sinatra/bldr.rb', line 16

def bldr(template, opts = {}, &block)
  opts[:scope] = ::Bldr::Node.new
  locals = opts.delete(:locals)
  render(:bldr, template, opts, locals, &block)
end