Class: Imap::Backup::Account::FolderBackup

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account:, folder:, refresh: false) ⇒ FolderBackup

Returns a new instance of FolderBackup.



18
19
20
21
22
# File 'lib/imap/backup/account/folder_backup.rb', line 18

def initialize(account:, folder:, refresh: false)
  @account = 
  @folder = folder
  @refresh = refresh
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



14
15
16
# File 'lib/imap/backup/account/folder_backup.rb', line 14

def 
  @account
end

#folderObject (readonly)

Returns the value of attribute folder.



15
16
17
# File 'lib/imap/backup/account/folder_backup.rb', line 15

def folder
  @folder
end

#refreshObject (readonly)

Returns the value of attribute refresh.



16
17
18
# File 'lib/imap/backup/account/folder_backup.rb', line 16

def refresh
  @refresh
end

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/imap/backup/account/folder_backup.rb', line 24

def run
  folder_ok = folder_ok?
  return if !folder_ok

  Logger.logger.debug "[#{folder.name}] running backup"

  serializer.apply_uid_validity(folder.uid_validity)

  download_serializer.transaction do
    downloader.run
  end

  clean_up
end