Class: HTTP::FormData::Part
- Inherits:
-
Object
- Object
- HTTP::FormData::Part
- Includes:
- Readable
- Defined in:
- lib/http/form_data/part.rb
Overview
Represents a body part of multipart/form-data request.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(body, content_type: nil, filename: nil) ⇒ Part
constructor
A new instance of Part.
Methods included from Readable
Constructor Details
#initialize(body, content_type: nil, filename: nil) ⇒ Part
Returns a new instance of Part.
23 24 25 26 27 |
# File 'lib/http/form_data/part.rb', line 23 def initialize(body, content_type: nil, filename: nil) @io = StringIO.new(body.to_s) @content_type = content_type @filename = filename end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
18 19 20 |
# File 'lib/http/form_data/part.rb', line 18 def content_type @content_type end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
18 19 20 |
# File 'lib/http/form_data/part.rb', line 18 def filename @filename end |