Method: PopCap::Fileable#restore
- Defined in:
- lib/pop_cap/fileable.rb
#restore(from_path = nil) ⇒ Object
Public: This will restore a file from the backup path. It will raise an error if file has no backup path.
from_path - The path from which to restore. It defaults to the #backup_path.
Examples
klass = SomeClass.new('path/to/file.txt').backup('/tmp')
klass.restore
109 110 111 112 |
# File 'lib/pop_cap/fileable.rb', line 109 def restore(from_path=nil) @from_path = from_path FileUtils.mv(restore_path, self.filepath) end |