Class: FSPath::Tempfile

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

Instance Method Summary collapse

Constructor Details

#initialize(path_klass, *args) ⇒ Tempfile

Returns a new instance of Tempfile.

Raises:

  • (ArgumentError)


7
8
9
10
11
# File 'lib/fspath.rb', line 7

def initialize(path_klass, *args)
  raise ArgumentError.new("#{path_klass.inspect} is not a class") unless path_klass.is_a?(Class)
  @path_klass = path_klass
  super(*args)
end

Instance Method Details

#pathObject



13
14
15
# File 'lib/fspath.rb', line 13

def path
  @path_klass.new(super)
end