Class: Reenrb::Actions::ForceDelete

Inherits:
Object
  • Object
show all
Defined in:
lib/reenrb/actions/force_delete.rb

Overview

Deletes a file

Instance Method Summary collapse

Constructor Details

#initialize(old_name, new_name) ⇒ ForceDelete

Returns a new instance of ForceDelete.



7
8
9
10
# File 'lib/reenrb/actions/force_delete.rb', line 7

def initialize(old_name, new_name)
  @old_name = old_name
  @new_name = new_name
end

Instance Method Details

#callObject



12
13
14
15
16
17
# File 'lib/reenrb/actions/force_delete.rb', line 12

def call
  FileUtils.rm_rf(@old_name)
  nil
rescue Errno::ENOENT
  "Could not force delete"
end