Skip to content

Instantly share code, notes, and snippets.

@krzysztofjablonski
Created August 16, 2011 09:41
Show Gist options
  • Save krzysztofjablonski/1148737 to your computer and use it in GitHub Desktop.
Save krzysztofjablonski/1148737 to your computer and use it in GitHub Desktop.
module Rack
module Test
module Utils # :nodoc:
private
def build_primitive_part(parameter_name, value)
unless value.is_a? Array
value = [value]
end
value.map do |v|
<<-EOF
--#{MULTIPART_BOUNDARY}\r
Content-Disposition: form-data; name="#{parameter_name}"\r
\r
#{v}\r
EOF
end.join
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment