Extended maintenance of Ruby versions 1.8.7 and 1.9.2 will end on July 31, 2014. Read more

In Files

  • net/smtp.rb

Net::SMTP::Response

Attributes

status[R]
string[R]

Public Class Methods

new(status, string) click to toggle source
 
               # File net/smtp.rb, line 969
def initialize(status, string)
  @status = status
  @string = string
end
            
parse(str) click to toggle source
 
               # File net/smtp.rb, line 965
def Response.parse(str)
  new(str[0,3], str)
end
            

Public Instance Methods

capabilities() click to toggle source
 
               # File net/smtp.rb, line 997
def capabilities
  return {} unless @string[3, 1] == '-'
  h = {}
  @string.lines.drop(1).each do |line|
    k, *v = line[4..-1].chomp.split(nil)
    h[k] = v
  end
  h
end
            
continue?() click to toggle source
 
               # File net/smtp.rb, line 985
def continue?
  status_type_char() == '3'
end
            
cram_md5_challenge() click to toggle source
 
               # File net/smtp.rb, line 993
def cram_md5_challenge
  @string.split(/ /)[1].unpack('m')[0]
end
            
exception_class() click to toggle source
 
               # File net/smtp.rb, line 1007
def exception_class
  case @status
  when /\A4/  then SMTPServerBusy
  when /\A50/ then SMTPSyntaxError
  when /\A53/ then SMTPAuthenticationError
  when /\A5/  then SMTPFatalError
  else             SMTPUnknownError
  end
end
            
message() click to toggle source
 
               # File net/smtp.rb, line 989
def message
  @string.lines.first
end
            
status_type_char() click to toggle source
 
               # File net/smtp.rb, line 977
def status_type_char
  @status[0, 1]
end
            
success?() click to toggle source
 
               # File net/smtp.rb, line 981
def success?
  status_type_char() == '2'
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus