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/)
  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