Class: Imap::Backup::Account::FolderEnsurer
- Inherits:
-
Object
- Object
- Imap::Backup::Account::FolderEnsurer
- Defined in:
- lib/imap/backup/account/folder_ensurer.rb
Overview
Handles creation of directories for backup storage
Instance Method Summary collapse
-
#initialize(account:) ⇒ FolderEnsurer
constructor
A new instance of FolderEnsurer.
- #run ⇒ Object
Constructor Details
#initialize(account:) ⇒ FolderEnsurer
Returns a new instance of FolderEnsurer.
11 12 13 |
# File 'lib/imap/backup/account/folder_ensurer.rb', line 11 def initialize(account:) @account = account end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/imap/backup/account/folder_ensurer.rb', line 15 def run raise "The backup path for #{account.username} is not set" if !account.local_path Serializer::FolderMaker.new( base: File.dirname(account.local_path), path: File.basename(account.local_path), permissions: Serializer::Directory::DIRECTORY_PERMISSIONS ).run end |