Class: Translatomatic::HTTP::Param
- Inherits:
-
Object
- Object
- Translatomatic::HTTP::Param
- Defined in:
- lib/translatomatic/http/param.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 ⇒ String
Representation of this parameter as it appears within a multipart post request.
Constructor Details
#initialize(key:, value:) ⇒ Param
Returns a new instance of Param.
7 8 9 10 |
# File 'lib/translatomatic/http/param.rb', line 7 def initialize(key:, value:) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
5 6 7 |
# File 'lib/translatomatic/http/param.rb', line 5 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/translatomatic/http/param.rb', line 5 def value @value end |
Instance Method Details
#to_s ⇒ String
Returns Representation of this parameter as it appears within a multipart post request.
14 15 16 |
# File 'lib/translatomatic/http/param.rb', line 14 def to_s header(header_data) + "\r\n#{value}\r\n" end |