Class: Wunderbar::Template::Json
- Defined in:
- lib/wunderbar/sinatra.rb
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
105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/wunderbar/sinatra.rb', line 105 def evaluate(scope, locals, &block) builder = JsonBuilder.new(scope) begin _evaluate_safely(builder, scope, locals, &block) rescue Exception => exception scope.content_type self.class.default_mime_type, :charset => 'utf-8' scope.response.status = 500 builder._exception exception end builder.target! end |