Class: Imap::Backup::Account::FolderEnsurer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account:) ⇒ FolderEnsurer

Returns a new instance of FolderEnsurer.



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

def initialize(account:)
  @account = 
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



10
11
12
# File 'lib/imap/backup/account/folder_ensurer.rb', line 10

def 
  @account
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
# File 'lib/imap/backup/account/folder_ensurer.rb', line 16

def run
  raise "The backup path for #{.username} is not set" if !.local_path

  Serializer::FolderMaker.new(
    base: File.dirname(.local_path),
    path: File.basename(.local_path),
    permissions: Serializer::Directory::DIRECTORY_PERMISSIONS
  ).run
end