Class: Imap::Backup::Setup::ConnectionTester
- Inherits:
-
Object
- Object
- Imap::Backup::Setup::ConnectionTester
- Defined in:
- lib/imap/backup/setup/connection_tester.rb
Overview
Attempts to login to an account and reports the result
Instance Method Summary collapse
-
#initialize(account) ⇒ ConnectionTester
constructor
A new instance of ConnectionTester.
-
#test ⇒ void
Carries out the attempted login and indicates whether it was successful.
Constructor Details
#initialize(account) ⇒ ConnectionTester
Returns a new instance of ConnectionTester.
11 12 13 |
# File 'lib/imap/backup/setup/connection_tester.rb', line 11 def initialize(account) @account = account end |
Instance Method Details
#test ⇒ void
This method returns an undefined value.
Carries out the attempted login and indicates whether it was successful
18 19 20 21 22 23 24 25 |
# File 'lib/imap/backup/setup/connection_tester.rb', line 18 def test account.client.login "Connection successful" rescue Net::IMAP::NoResponseError "No response" rescue StandardError => e "Unexpected error: #{e}" end |