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