Class: Reenrb::Actions::ForceDelete
- Inherits:
-
Object
- Object
- Reenrb::Actions::ForceDelete
- Defined in:
- lib/reenrb/actions/force_delete.rb
Overview
Deletes a file
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(old_name, new_name) ⇒ ForceDelete
constructor
A new instance of ForceDelete.
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
#call ⇒ Object
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 |