1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

simplify capture method

This commit is contained in:
Konstantin Haase 2011-04-22 13:56:58 +02:00
parent 972558e0ad
commit 24cb84e274

View file

@ -88,11 +88,8 @@ module Sinatra
capture[:slim] = "== yield(*args)"
def capture(engine, args, block)
@_out_buf, buf_was = nil, @_out_buf
eval '_buf.clear if defined? _buf', block.binding
render(engine, Sinatra::ContentFor.capture.fetch(engine), {}, :args => args, :block => block, &block)
ensure
@_out_buf = buf_was
end
def render(engine, *)