Class: MagicShelf::FileCleaner

Inherits:
Object
  • Object
show all
Defined in:
lib/magicshelf/filecleaner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fileObject

Returns the value of attribute file.



7
8
9
# File 'lib/magicshelf/filecleaner.rb', line 7

def file
  @file
end

Instance Method Details

#enterObject



9
10
11
12
# File 'lib/magicshelf/filecleaner.rb', line 9

def enter()
  #raise MagicShelf::FileCleanerError.new("workdir is not set") if @workdir == nil
  yield
end

#processObject



14
15
16
# File 'lib/magicshelf/filecleaner.rb', line 14

def process()
  FileUtils.remove_file(@file)
end