Class: BFS::Writer
- Inherits:
-
Tempfile
- Object
- Tempfile
- BFS::Writer
- Includes:
- Mixin
- Defined in:
- lib/bfs/helpers.rb
Defined Under Namespace
Modules: Mixin
Instance Method Summary collapse
-
#initialize(name, tempdir: nil, perm: nil, **opts, &on_commit) ⇒ Writer
constructor
A new instance of Writer.
Methods included from Mixin
Constructor Details
#initialize(name, tempdir: nil, perm: nil, **opts, &on_commit) ⇒ Writer
Returns a new instance of Writer.
36 37 38 39 40 41 42 |
# File 'lib/bfs/helpers.rb', line 36 def initialize(name, tempdir: nil, perm: nil, **opts, &on_commit) @on_commit = on_commit tempfile = ::Tempfile.new(File.basename(name.to_s), tempdir, **opts) tempfile.chmod(perm) if perm super tempfile end |