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 969
969:       def initialize(status, string)
970:         @status = status
971:         @string = string
972:       end

[Source]

     # File lib/net/smtp.rb, line 965
965:       def Response.parse(str)
966:         new(str[0,3], str)
967:       end

Public Instance methods

[Source]

      # File lib/net/smtp.rb, line 997
 997:       def capabilities
 998:         return {} unless @string[3, 1] == '-'
 999:         h = {}
1000:         @string.lines.drop(1).each do |line|
1001:           k, *v = line[4..-1].chomp.split(nil)
1002:           h[k] = v
1003:         end
1004:         h
1005:       end

[Source]

     # File lib/net/smtp.rb, line 985
985:       def continue?
986:         status_type_char() == '3'
987:       end

[Source]

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

[Source]

      # File lib/net/smtp.rb, line 1007
1007:       def exception_class
1008:         case @status
1009:         when /\A4/  then SMTPServerBusy
1010:         when /\A50/ then SMTPSyntaxError
1011:         when /\A53/ then SMTPAuthenticationError
1012:         when /\A5/  then SMTPFatalError
1013:         else             SMTPUnknownError
1014:         end
1015:       end

[Source]

     # File lib/net/smtp.rb, line 989
989:       def message
990:         @string.lines.first
991:       end

[Source]

     # File lib/net/smtp.rb, line 977
977:       def status_type_char
978:         @status[0, 1]
979:       end

[Source]

     # File lib/net/smtp.rb, line 981
981:       def success?
982:         status_type_char() == '2'
983:       end

[Validate]