Class: Multipart::StringParam
- Inherits:
-
Object
- Object
- Multipart::StringParam
- Defined in:
- lib/multipart/post.rb
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(k, v) ⇒ StringParam
constructor
A new instance of StringParam.
- #to_multipart ⇒ Object
Constructor Details
#initialize(k, v) ⇒ StringParam
Returns a new instance of StringParam.
51 52 53 54 |
# File 'lib/multipart/post.rb', line 51 def initialize(k, v) @k = k @v = v end |
Instance Attribute Details
#k ⇒ Object
Returns the value of attribute k.
49 50 51 |
# File 'lib/multipart/post.rb', line 49 def k @k end |
#v ⇒ Object
Returns the value of attribute v.
49 50 51 |
# File 'lib/multipart/post.rb', line 49 def v @v end |
Instance Method Details
#to_multipart ⇒ Object
56 57 58 |
# File 'lib/multipart/post.rb', line 56 def to_multipart return "Content-Disposition: form-data; name=\"#{URI::encode(k)}\"\r\n\r\n#{v}\r\n" end |