Class: Wunderbar::Template::Html

Inherits:
Base
  • Object
show all
Defined in:
lib/wunderbar/sinatra.rb

Direct Known Subclasses

Xhtml

Instance Method Summary collapse

Methods inherited from Base

engine_initialized?, evaluate, #initialize_engine, #precompiled_postamble, #precompiled_preamble, #precompiled_template, #prepare

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/wunderbar/sinatra.rb', line 108

def evaluate(scope, locals, &block)
  builder = HtmlMarkup.new(scope)
  begin
    _evaluate_safely(builder, scope, locals, &block)
  rescue Exception => exception
    scope.response.status = Wunderbar::ServerError.status
    builder.clear!
    builder.html do
      _h1 'Internal Server Error'
      _exception exception
    end
  end
  builder._.target!
end