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

In Files

  • soap/mimemessage.rb

Class/Module Index [+]

Quicksearch

SOAP::MIMEMessage::Part

Attributes

body[RW]
content[RW]
headers[RW]

Public Class Methods

new() click to toggle source
 
               # File soap/mimemessage.rb, line 111
def initialize
  @headers = Headers.new
  @headers.add("Content-Transfer-Encoding", "8bit")
  @body = nil
  @contentid = nil
end
            
parse(str) click to toggle source
 
               # File soap/mimemessage.rb, line 118
def self.parse(str)
  new.parse(str)
end
            

Public Instance Methods

contentid() click to toggle source
 
               # File soap/mimemessage.rb, line 133
def contentid
  if @contentid == nil and @headers.key?('content-id')
    @contentid = @headers['content-id'].str
    @contentid = $1 if @contentid =~ /^<(.+)>$/
  end
  @contentid
end
            
parse(str) click to toggle source
 
               # File soap/mimemessage.rb, line 122
def parse(str)
  headers, body = str.split(/\r\n\r\n/s)
  if headers != nil and body != nil
    @headers = Headers.parse(headers)
    @body = body.sub(/\r\n\z/, '')
  else
    raise RuntimeError.new("unexpected part: #{str.inspect}")
  end
  self
end
            
to_s() click to toggle source
 
               # File soap/mimemessage.rb, line 143
def to_s
  @headers.to_s + "\r\n\r\n" + @body
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