Class: FileProcessor::Tempfile

Inherits:
Tempfile
  • Object
show all
Defined in:
lib/file_processor/temp_file.rb

Instance Method Summary collapse

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

#pathObject



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