Class: Imap::Backup::Account::ClientFactory
- Inherits:
-
Object
- Object
- Imap::Backup::Account::ClientFactory
- Defined in:
- lib/imap/backup/account/client_factory.rb
Overview
Returns an IMAP client set up for the supplied account
Instance Method Summary collapse
-
#initialize(account:) ⇒ ClientFactory
constructor
A new instance of ClientFactory.
-
#run ⇒ Client::AutomaticLoginWrapper
A client for the account.
Constructor Details
#initialize(account:) ⇒ ClientFactory
Returns a new instance of ClientFactory.
13 14 15 |
# File 'lib/imap/backup/account/client_factory.rb', line 13 def initialize(account:) @account = account end |
Instance Method Details
#run ⇒ Client::AutomaticLoginWrapper
Returns a client for the account.
18 19 20 21 22 |
# File 'lib/imap/backup/account/client_factory.rb', line 18 def run Logger.logger.debug("Creating IMAP instance") client = Client::Default.new(account) Client::AutomaticLoginWrapper.new(client: client) end |