Class: Translatomatic::HTTPRequest::Param
- Inherits:
-
Object
- Object
- Translatomatic::HTTPRequest::Param
- Defined in:
- lib/translatomatic/http_request.rb
Overview
Formats a basic string key/value pair for a multipart post
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key:, value:) ⇒ Param
constructor
A new instance of Param.
- #to_s ⇒ Object
Constructor Details
#initialize(key:, value:) ⇒ Param
Returns a new instance of Param.
68 69 70 71 |
# File 'lib/translatomatic/http_request.rb', line 68 def initialize(key:, value:) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
66 67 68 |
# File 'lib/translatomatic/http_request.rb', line 66 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
66 67 68 |
# File 'lib/translatomatic/http_request.rb', line 66 def value @value end |
Instance Method Details
#to_s ⇒ Object
73 74 75 |
# File 'lib/translatomatic/http_request.rb', line 73 def to_s return header(header_data) + "\r\n#{value}\r\n" end |