Class: Imap::Backup::Setup::ConnectionTester

Inherits:
Object
  • Object
show all
Defined in:
lib/imap/backup/setup/connection_tester.rb

Overview

Attempts to login to an account and reports the result

Instance Method Summary collapse

Constructor Details

#initialize(account) ⇒ ConnectionTester

Returns a new instance of ConnectionTester.

Parameters:



11
12
13
# File 'lib/imap/backup/setup/connection_tester.rb', line 11

def initialize()
  @account = 
end

Instance Method Details

#testvoid

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
  .client.
  "Connection successful"
rescue Net::IMAP::NoResponseError
  "No response"
rescue StandardError => e
  "Unexpected error: #{e}"
end