Class: Multipart::Param

Inherits:
Object
  • Object
show all
Defined in:
lib/multipart.rb

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/multipart.rb', line 18

def initialize( k, v )
  @k = k
  @v = v
end

Instance Attribute Details

#kObject

Returns the value of attribute k.



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

def k
  @k
end

#vObject

Returns the value of attribute v.



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

def v
  @v
end

Instance Method Details

#to_multipartObject



23
24
25
26
27
# File 'lib/multipart.rb', line 23

def to_multipart
  #return "Content-Disposition: form-data; name=\"#{CGI::escape(k)}\"\r\n\r\n#{v}\r\n"
  # Don't escape mine...
  return "Content-Disposition: form-data; name=\"#{k}\"\r\n\r\n#{v}\r\n"
end