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
headersHash Headers for the part.
-
parameter
contentString 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
writableIO The destination stream to write to.
-
parameter
boundaryString The boundary string for the multipart message.
Implementation
def call(writable, boundary)
writable.write(@content)
end