Class: Multipart::Param
- Inherits:
-
Object
- Object
- Multipart::Param
- Defined in:
- lib/vendor/tinder/lib/tinder/multipart.rb
Overview
From: deftcode.com/code/flickr_upload/multipartpost.rb Helper class to prepare an HTTP POST request with a file upload Mostly taken from blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/113774 WAS: Anything that’s broken and wrong probably the fault of Bill Stilwell ([email protected]) NOW: Everything wrong is due to [email protected]
Instance Attribute Summary collapse
-
#k ⇒ Object
:nodoc:.
-
#v ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#initialize(k, v) ⇒ Param
constructor
A new instance of Param.
- #to_multipart ⇒ Object
Constructor Details
#initialize(k, v) ⇒ Param
Returns a new instance of Param.
18 19 20 21 |
# File 'lib/vendor/tinder/lib/tinder/multipart.rb', line 18 def initialize(k, v) @k = k @v = v end |
Instance Attribute Details
#k ⇒ Object
:nodoc:
17 18 19 |
# File 'lib/vendor/tinder/lib/tinder/multipart.rb', line 17 def k @k end |
#v ⇒ Object
:nodoc:
17 18 19 |
# File 'lib/vendor/tinder/lib/tinder/multipart.rb', line 17 def v @v end |
Instance Method Details
#to_multipart ⇒ Object
23 24 25 |
# File 'lib/vendor/tinder/lib/tinder/multipart.rb', line 23 def to_multipart "Content-Disposition: form-data; name=\"#{k}\"\r\n\r\n#{v}\r\n" end |