Class: DuoSplitter::TempDirWrapper
- Inherits:
-
Object
- Object
- DuoSplitter::TempDirWrapper
- Defined in:
- lib/duo_splitter/temp_dir_wrapper.rb
Instance Method Summary collapse
-
#initialize(context:) ⇒ TempDirWrapper
constructor
A new instance of TempDirWrapper.
- #run ⇒ Object
Constructor Details
#initialize(context:) ⇒ TempDirWrapper
Returns a new instance of TempDirWrapper.
8 9 10 |
# File 'lib/duo_splitter/temp_dir_wrapper.rb', line 8 def initialize(context:) @context = context end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/duo_splitter/temp_dir_wrapper.rb', line 12 def run Dir.mktmpdir do |dirname| @context.temp_dir = Pathname.new(dirname) yield end end |