Class: Multipart::StringParam

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#kObject

Returns the value of attribute k.



49
50
51
# File 'lib/multipart/post.rb', line 49

def k
  @k
end

#vObject

Returns the value of attribute v.



49
50
51
# File 'lib/multipart/post.rb', line 49

def v
  @v
end

Instance Method Details

#to_multipartObject



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