class Tempfile
Public Class Methods
open(*args) { |tempfile| ... }
click to toggle source
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 tempfile – in contrast to the original implementation, which returns nil
.
# File lib/nuggets/tempfile/open.rb 41 def open(*args) 42 tempfile = new(*args) 43 44 if block_given? 45 begin 46 yield tempfile 47 ensure 48 tempfile.close 49 end 50 end 51 52 tempfile 53 end
Also aliased as: _nuggets_original_open