Class: FileProcessor::Tempfile
- Inherits:
-
Tempfile
- Object
- Tempfile
- FileProcessor::Tempfile
- Defined in:
- lib/file_processor/temp_file.rb
Instance Method Summary collapse
-
#initialize(basename = 'file-processor', *args) ⇒ Tempfile
constructor
A new instance of Tempfile.
- #path ⇒ Object
- #reopen(mode) ⇒ Object
Constructor Details
#initialize(basename = 'file-processor', *args) ⇒ Tempfile
Returns a new instance of Tempfile.
3 4 5 |
# File 'lib/file_processor/temp_file.rb', line 3 def initialize(basename='file-processor', *args) super(basename, *args) end |
Instance Method Details
#path ⇒ Object
7 8 9 |
# File 'lib/file_processor/temp_file.rb', line 7 def path @tmpname end |
#reopen(mode) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/file_processor/temp_file.rb', line 11 def reopen(mode) close unless closed? @mode = mode @tmpfile = File.open(path, mode, @opts) @data[1] = @tmpfile __setobj__(@tmpfile) end |