class StringPart < Part

Inherits from
Part

A part that contains string content. Represents a multipart part with string data.

Definitions

def initialize(headers, content)

Initialize a new StringPart with headers and string content.

Signature

parameter headers Hash

Headers for the part.

parameter content String

The string content of the part.

Implementation

def initialize(headers, content)
	super(headers)
	@content = content
end

attr_reader :content

Signature

attribute String

The content of the part.

def call(writable, boundary)

Write the part's content to the provided writable stream.

Signature

parameter writable IO

The destination stream to write to.

parameter boundary String

The boundary string for the multipart message.

Implementation

def call(writable, boundary)
	writable.write(@content)
end