Class: Protocol::Multipart::StringPart
- Defined in:
- lib/protocol/multipart/string_part.rb
Overview
A part that contains string content. Represents a multipart part with string data.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
- #The content of the part.(contentofthepart.) ⇒ Object readonly
Attributes inherited from Part
Instance Method Summary collapse
-
#call(writable, boundary) ⇒ Object
Write the part’s content to the provided writable stream.
-
#initialize(headers, content) ⇒ StringPart
constructor
Initialize a new StringPart with headers and string content.
Methods inherited from Part
#The headers as name/value pairs.=
Constructor Details
#initialize(headers, content) ⇒ StringPart
Initialize a new StringPart with headers and string content.
17 18 19 20 |
# File 'lib/protocol/multipart/string_part.rb', line 17 def initialize(headers, content) super(headers) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
23 24 25 |
# File 'lib/protocol/multipart/string_part.rb', line 23 def content @content end |
#The content of the part.(contentofthepart.) ⇒ Object (readonly)
23 |
# File 'lib/protocol/multipart/string_part.rb', line 23 attr_reader :content |
Instance Method Details
#call(writable, boundary) ⇒ Object
Write the part’s content to the provided writable stream.
29 30 31 |
# File 'lib/protocol/multipart/string_part.rb', line 29 def call(writable, boundary) writable.write(@content) end |