Class: Imap::Backup::Account::Connection::BackupFolders
- Inherits:
-
Object
- Object
- Imap::Backup::Account::Connection::BackupFolders
- Defined in:
- lib/imap/backup/account/connection/backup_folders.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client:, account:) ⇒ BackupFolders
constructor
A new instance of BackupFolders.
- #run ⇒ Object
Constructor Details
#initialize(client:, account:) ⇒ BackupFolders
Returns a new instance of BackupFolders.
9 10 11 12 |
# File 'lib/imap/backup/account/connection/backup_folders.rb', line 9 def initialize(client:, account:) @client = client @account = account end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
6 7 8 |
# File 'lib/imap/backup/account/connection/backup_folders.rb', line 6 def account @account end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/imap/backup/account/connection/backup_folders.rb', line 7 def client @client end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/imap/backup/account/connection/backup_folders.rb', line 14 def run names = if account.folders&.any? account.folders.map { |af| af[:name] } else Account::Connection::FolderNames.new(client: client, account: account).run end names.map do |name| Account::Folder.new(account.connection, name) end end |