Class: Sdk4me::Multipart::StringParam

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

Overview

Formats a basic string key/value pair for inclusion with a multipart post

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ StringParam

Returns a new instance of StringParam.



45
46
47
48
# File 'lib/sdk4me/client/multipart.rb', line 45

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

Instance Attribute Details

#kObject

Returns the value of attribute k.



43
44
45
# File 'lib/sdk4me/client/multipart.rb', line 43

def k
  @k
end

#vObject

Returns the value of attribute v.



43
44
45
# File 'lib/sdk4me/client/multipart.rb', line 43

def v
  @v
end

Instance Method Details

#to_multipartObject



50
51
52
# File 'lib/sdk4me/client/multipart.rb', line 50

def to_multipart
  %(Content-Disposition: form-data; name="#{CGI.escape(k.to_s)}"\r\n\r\n#{v}\r\n)
end