class Faraday::Parts::ParamPart
Public Class Methods
new(boundary, name, value, headers = {})
click to toggle source
# File lib/restforce/patches/parts.rb, line 19 def initialize(boundary, name, value, headers = {}) @part = build_part(boundary, name, value, headers) @io = StringIO.new(@part) end
Public Instance Methods
build_part(boundary, name, value, headers = {})
click to toggle source
# File lib/restforce/patches/parts.rb, line 24 def build_part(boundary, name, value, headers = {}) part = '' part << "--#{boundary}\r\n" part << "Content-Disposition: form-data; name=\"#{name}\"\r\n" part << "Content-Type: #{headers['Content-Type']}\r\n" if headers["Content-Type"] part << "\r\n" part << "#{value}\r\n" end