If no block is given, this is a synonym for new().
If a block is given, it will be passed tempfile as an argument, and the
tempfile will automatically be closed when the block terminates. In this
case, open() returns nil.
# File lib/tempfile.rb, line 183
def open(*args)
tempfile = new(*args)
if block_given?
begin
yield(tempfile)
ensure
tempfile.close
end
nil
else
tempfile
end
end