Class: Imap::Backup::Client::AutomaticLoginWrapper

Inherits:
Object
  • Object
show all
Includes:
RetryOnError
Defined in:
lib/imap/backup/client/automatic_login_wrapper.rb

Constant Summary collapse

LOGIN_RETRY_CLASSES =
[::EOFError, ::Errno::ECONNRESET, ::SocketError].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RetryOnError

#retry_on_error

Constructor Details

#initialize(client:) ⇒ AutomaticLoginWrapper

Returns a new instance of AutomaticLoginWrapper.



16
17
18
19
# File 'lib/imap/backup/client/automatic_login_wrapper.rb', line 16

def initialize(client:)
  @client = client
  @login_called = false
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *arguments, &block) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/imap/backup/client/automatic_login_wrapper.rb', line 21

def method_missing(method_name, *arguments, &block)
  if 
    client.send(method_name, *arguments, &block)
  else
    
    client.send(method_name, *arguments, &block) if method_name != :login
  end
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



13
14
15
# File 'lib/imap/backup/client/automatic_login_wrapper.rb', line 13

def client
  @client
end

#login_calledObject (readonly)

Returns the value of attribute login_called.



14
15
16
# File 'lib/imap/backup/client/automatic_login_wrapper.rb', line 14

def 
  @login_called
end

Instance Method Details

#respond_to_missing?(method_name, _include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/imap/backup/client/automatic_login_wrapper.rb', line 30

def respond_to_missing?(method_name, _include_private = false)
  client.respond_to?(method_name)
end