Class: MotherBrain::FileSystem::Tempfile

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

Overview

Thin wrapper around ::Tempfile to ensure we always write temporary files into motherbrain’s configured temporary directory

Constant Summary collapse

BASENAME =
'mb_'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Tempfile

Returns a new instance of Tempfile.

Parameters:

  • options (Hash) (defaults to: {})

    options to pass to ::Tempfile.new



20
21
22
# File 'lib/mb/file_system/tempfile.rb', line 20

def initialize(options = {})
  super(BASENAME, FileSystem.tmpdir, options)
end

Class Method Details

.open(options = {}) ⇒ Object

Parameters:

  • options (Hash) (defaults to: {})

    options to pass to ::Tempfile.open



13
14
15
# File 'lib/mb/file_system/tempfile.rb', line 13

def open(options = {})
  super(options)
end