Class Net::SMTP::Response
In: lib/net/smtp.rb
Parent: Object

Methods

Attributes

status  [R] 
string  [R] 

Public Class methods

[Source]

     # File lib/net/smtp.rb, line 957
957:       def initialize(status, string)
958:         @status = status
959:         @string = string
960:       end

[Source]

     # File lib/net/smtp.rb, line 953
953:       def Response.parse(str)
954:         new(str[0,3], str)
955:       end

Public Instance methods

[Source]

     # File lib/net/smtp.rb, line 985
985:       def capabilities
986:         return {} unless @string[3, 1] == '-'
987:         h = {}
988:         @string.lines.drop(1).each do |line|
989:           k, *v = line[4..-1].chomp.split(nil)
990:           h[k] = v
991:         end
992:         h
993:       end

[Source]

     # File lib/net/smtp.rb, line 973
973:       def continue?
974:         status_type_char() == '3'
975:       end

[Source]

     # File lib/net/smtp.rb, line 981
981:       def cram_md5_challenge
982:         @string.split(/ /)[1].unpack('m')[0]
983:       end

[Source]

      # File lib/net/smtp.rb, line 995
 995:       def exception_class
 996:         case @status
 997:         when /\A4/  then SMTPServerBusy
 998:         when /\A50/ then SMTPSyntaxError
 999:         when /\A53/ then SMTPAuthenticationError
1000:         when /\A5/  then SMTPFatalError
1001:         else             SMTPUnknownError
1002:         end
1003:       end

[Source]

     # File lib/net/smtp.rb, line 977
977:       def message
978:         @string.lines.first
979:       end

[Source]

     # File lib/net/smtp.rb, line 965
965:       def status_type_char
966:         @status[0, 1]
967:       end

[Source]

     # File lib/net/smtp.rb, line 969
969:       def success?
970:         status_type_char() == '2'
971:       end

[Validate]