Module: Sinatra::BlockHTML

Included in:
Base
Defined in:
lib/sinatra-block-html.rb

Instance Method Summary collapse

Instance Method Details

#bhtml(template = nil, options = {}, locals = {}, &block) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/sinatra-block-html.rb', line 6

def bhtml(template=nil, options={}, locals={}, &block)
  require_warn('BlockHTML') unless defined?(::BlockHTML)

  options, template = template, nil if template.is_a?(Hash)
  template = lambda { block } if template.nil?
  render(:bhtml, template, options, locals).to_s
end