Class SOAP::MIMEMessage::Part
In: soap/mimemessage.rb
Parent: Object

Methods

contentid   new   parse   parse   to_s  

External Aliases

body -> content

Attributes

body  [RW] 
headers  [RW] 

Public Class methods

[Source]

# File soap/mimemessage.rb, line 111
    def initialize
      @headers = Headers.new
      @headers.add("Content-Transfer-Encoding", "8bit")
      @body = nil
      @contentid = nil
    end

[Source]

# File soap/mimemessage.rb, line 118
    def self.parse(str)
      new.parse(str)
    end

Public Instance methods

[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

[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

[Source]

# File soap/mimemessage.rb, line 143
    def to_s
      @headers.to_s + "\r\n\r\n" + @body
    end

[Validate]

ruby-doc.org is hosted and maintained by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.