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.



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

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

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



12
13
14
# File 'lib/imap/backup/account/folder_backup.rb', line 12

def 
  @account
end

#folderObject (readonly)

Returns the value of attribute folder.



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

def folder
  @folder
end

#refreshObject (readonly)

Returns the value of attribute refresh.



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

def refresh
  @refresh
end

Instance Method Details

#runObject



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

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