Class: Imap::Backup::Account::FolderEnsurer
- Inherits:
-
Object
- Object
- Imap::Backup::Account::FolderEnsurer
- Defined in:
- lib/imap/backup/account/folder_ensurer.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
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.
12 13 14 |
# File 'lib/imap/backup/account/folder_ensurer.rb', line 12 def initialize(account:) @account = account end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
10 11 12 |
# File 'lib/imap/backup/account/folder_ensurer.rb', line 10 def account @account end |
Instance Method Details
#run ⇒ Object
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 #{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 |