Class: Reenrb::Actions::Delete
- Inherits:
-
Object
- Object
- Reenrb::Actions::Delete
- Defined in:
- lib/reenrb/actions/delete.rb
Overview
Deletes a file
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(old_name, new_name) ⇒ Delete
constructor
A new instance of Delete.
Constructor Details
#initialize(old_name, new_name) ⇒ Delete
Returns a new instance of Delete.
7 8 9 10 |
# File 'lib/reenrb/actions/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/delete.rb', line 12 def call File.delete(@old_name) nil rescue Errno::ENOENT "Could not delete" end |