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.

Parameters:

  • account (Account)

    the account whose backups will be restored

  • delimiter (String) (defaults to: "/")

    the destination folder delimiter

  • prefix (String) (defaults to: "")

    a prefix applied to restored folder names



15
16
17
18
19
20
# File 'lib/imap/backup/account/restore.rb', line 15

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



24
25
26
27
28
29
30
# File 'lib/imap/backup/account/restore.rb', line 24

def run
  locker.with_lock do
    folders.each do |serializer, folder|
      Uploader.new(folder, serializer).run
    end
  end
end