Class: WickedPdfTempfile

Inherits:
Tempfile
  • Object
show all
Defined in:
lib/wicked_pdf/tempfile.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename, temp_dir = nil) ⇒ WickedPdfTempfile

ensures the Tempfile's filename always keeps its extension


5
6
7
8
9
10
# File 'lib/wicked_pdf/tempfile.rb', line 5

def initialize(filename, temp_dir = nil)
  temp_dir  ||= Dir.tmpdir
  extension = File.extname(filename)
  basename  = File.basename(filename, extension)
  super([basename, extension], temp_dir)
end