Class: Imap::Backup::Account::Restore

Inherits:
Object
  • Object
show all
Defined in:
lib/imap/backup/account/restore.rb

Overview

Restores all backed up folders to the server

Instance Method Summary collapse

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 = 
  @destination_delimiter = delimiter
  @destination_prefix = prefix
  @locker = nil
end

Instance Method Details

#runvoid

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