Class: MagicShelf::FileMover

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#inputfileObject

Returns the value of attribute inputfile.



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

def inputfile
  @inputfile
end

#outputfileObject

Returns the value of attribute outputfile.



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

def outputfile
  @outputfile
end

Instance Method Details

#enterObject



11
12
13
14
15
16
17
# File 'lib/magicshelf/filemover.rb', line 11

def enter()
  MagicShelf.logger.debug('enter FileMover')
  raise MagicShelf::FileMoverError.new("inputfile is not set") if @inputfile == nil
  raise MagicShelf::FileMoverError.new("outputfile is not set") if @outputfile == nil

  yield
end

#processObject



19
20
21
# File 'lib/magicshelf/filemover.rb', line 19

def process()
  FileUtils.mv(@inputfile, @outputfile)
end