Class: Multipart::Param

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#kObject

:nodoc:



17
18
19
# File 'lib/vendor/tinder/lib/tinder/multipart.rb', line 17

def k
  @k
end

#vObject

:nodoc:



17
18
19
# File 'lib/vendor/tinder/lib/tinder/multipart.rb', line 17

def v
  @v
end

Instance Method Details

#to_multipartObject



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