Class: Imap::Backup::CLI::Single::Backup

Inherits:
Object
  • Object
show all
Defined in:
lib/imap/backup/cli/single/backup.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Backup

Returns a new instance of Backup.



14
15
16
17
# File 'lib/imap/backup/cli/single/backup.rb', line 14

def initialize(options)
  @options = options
  @password = nil
end

Instance Method Details

#runObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/imap/backup/cli/single/backup.rb', line 19

def run
  process_options!
   = Account.new(
    username: email,
    password: password,
    server: server,
    download_strategy: download_strategy,
    folder_blacklist: folder_blacklist,
    local_path: local_path,
    mirror: mirror,
    reset_seen_flags_after_fetch: reset_seen_flags_after_fetch
  )
  .connection_options = connection_options if connection_options
  .folders = folders if folders.any?
  .multi_fetch_size = multi_fetch_size if multi_fetch_size
  backup = Account::Backup.new(account: , refresh: refresh)
  backup.run
end