Class: Imap::Backup::Account::Restore
- Inherits:
-
Object
- Object
- Imap::Backup::Account::Restore
- Defined in:
- lib/imap/backup/account/restore.rb
Overview
Restores all backed up folders to the server
Instance Method Summary collapse
-
#initialize(account:, delimiter: "/", prefix: "") ⇒ Restore
constructor
A new instance of Restore.
-
#run ⇒ void
Runs the restore operation.
Constructor Details
#initialize(account:, delimiter: "/", prefix: "") ⇒ Restore
Returns a new instance of Restore.
12 13 14 15 16 17 |
# File 'lib/imap/backup/account/restore.rb', line 12 def initialize(account:, delimiter: "/", prefix: "") @account = account @destination_delimiter = delimiter @destination_prefix = prefix @locker = nil end |
Instance Method Details
#run ⇒ void
This method returns an undefined value.
Runs the restore operation
21 22 23 24 25 26 27 |
# File 'lib/imap/backup/account/restore.rb', line 21 def run locker.with_lock do folders.each do |serializer, folder| Uploader.new(folder, serializer).run end end end |