Class: Sdk4me::Multipart::StringParam
- Inherits:
-
Object
- Object
- Sdk4me::Multipart::StringParam
- Defined in:
- lib/sdk4me/client/multipart.rb
Overview
Formats a basic string key/value pair for inclusion with a multipart post
Instance Attribute Summary collapse
-
#k ⇒ Object
Returns the value of attribute k.
-
#v ⇒ Object
Returns the value of attribute v.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ StringParam
constructor
A new instance of StringParam.
- #to_multipart ⇒ Object
Constructor Details
#initialize(key, value) ⇒ StringParam
Returns a new instance of StringParam.
45 46 47 48 |
# File 'lib/sdk4me/client/multipart.rb', line 45 def initialize(key, value) @k = key @v = value end |
Instance Attribute Details
#k ⇒ Object
Returns the value of attribute k.
43 44 45 |
# File 'lib/sdk4me/client/multipart.rb', line 43 def k @k end |
#v ⇒ Object
Returns the value of attribute v.
43 44 45 |
# File 'lib/sdk4me/client/multipart.rb', line 43 def v @v end |
Instance Method Details
#to_multipart ⇒ Object
50 51 52 |
# File 'lib/sdk4me/client/multipart.rb', line 50 def to_multipart %(Content-Disposition: form-data; name="#{CGI.escape(k.to_s)}"\r\n\r\n#{v}\r\n) end |