# File lib/sinatra/capture.rb, line 17 def capture(*args, &block) @capture = nil if current_engine == :ruby result = block[*args] else buffer = eval '_buf if defined?(_buf)', block.binding old_buffer = buffer.dup if buffer dummy = DUMMIES.fetch(current_engine) options = { :layout => false, :locals => {:args => args, :block => block }} buffer.try :clear result = render(current_engine, dummy, options, &block) end result.strip.empty? && @capture ? @capture : result ensure buffer.try :replace, old_buffer end
Generated with the Darkfish Rdoc Generator 2.