class Erubi::CaptureBlockEngine::Buffer

def capture(*args)

restore the original data the receiver contained before returning.
given args to the block, return any data captured by the receiver, and
Temporarily clear the receiver before yielding to the block, yield the
def capture(*args)
  prev = dup
  replace("") # 1.8 support!
  yield(*args)
  dup
ensure
  replace(prev)
end