Class: Translatomatic::HTTPRequest::FileParam
- Defined in:
- lib/translatomatic/http_request.rb
Overview
Formats the contents of a file or string for a multipart post
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
Attributes inherited from Param
Instance Method Summary collapse
-
#to_s ⇒ String
Representation of this parameter as it appears within a multipart post request.
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
122 123 124 |
# File 'lib/translatomatic/http_request.rb', line 122 def content @content end |
#filename ⇒ Object
Returns the value of attribute filename.
122 123 124 |
# File 'lib/translatomatic/http_request.rb', line 122 def filename @filename end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
122 123 124 |
# File 'lib/translatomatic/http_request.rb', line 122 def mime_type @mime_type end |
Instance Method Details
#to_s ⇒ String
Returns Representation of this parameter as it appears within a multipart post request.
125 126 127 128 |
# File 'lib/translatomatic/http_request.rb', line 125 def to_s return header(header_data) + header("Content-Type": mime_type) + "\r\n#{content}\r\n" end |