Module: Net::SMTPError

Overview

Module mixed in to all SMTP error classes

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#responseObject (readonly)

This class is a module for backward compatibility. In later release, this module becomes a class.


37
38
39
# File 'lib/net/smtp.rb', line 37

def response
  @response
end

Instance Method Details

#initialize(response, message: nil) ⇒ Object


39
40
41
42
43
44
45
46
47
# File 'lib/net/smtp.rb', line 39

def initialize(response, message: nil)
  if response.is_a?(::Net::SMTP::Response)
    @response = response
    @message = message
  else
    @response = nil
    @message = message || response 
  end
end

#messageObject


49
50
51
# File 'lib/net/smtp.rb', line 49

def message
  @message || response.message
end