Class: Candid::Internal::Multipart::FormDataPart Private
- Inherits:
-
Object
- Object
- Candid::Internal::Multipart::FormDataPart
- Defined in:
- lib/candid/internal/multipart/multipart_form_data_part.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #contents ⇒ Object readonly private
- #filename ⇒ Object readonly private
- #headers ⇒ Object readonly private
- #name ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(name:, value:, filename: nil, headers: nil) ⇒ FormDataPart
constructor
private
A new instance of FormDataPart.
-
#to_hash ⇒ Hash
private
Converts the part to a hash suitable for serialization.
Constructor Details
#initialize(name:, value:, filename: nil, headers: nil) ⇒ FormDataPart
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FormDataPart.
16 17 18 19 20 21 |
# File 'lib/candid/internal/multipart/multipart_form_data_part.rb', line 16 def initialize(name:, value:, filename: nil, headers: nil) @name = name @contents = convert_to_content(value) @filename = filename @headers = headers end |
Instance Attribute Details
#contents ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/candid/internal/multipart/multipart_form_data_part.rb', line 10 def contents @contents end |
#filename ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/candid/internal/multipart/multipart_form_data_part.rb', line 10 def filename @filename end |
#headers ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/candid/internal/multipart/multipart_form_data_part.rb', line 10 def headers @headers end |
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/candid/internal/multipart/multipart_form_data_part.rb', line 10 def name @name end |
Instance Method Details
#to_hash ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Converts the part to a hash suitable for serialization.
26 27 28 29 30 31 32 33 34 |
# File 'lib/candid/internal/multipart/multipart_form_data_part.rb', line 26 def to_hash result = { name: @name, contents: @contents } result[:filename] = @filename if @filename result[:headers] = @headers if @headers result end |