class Bambora::Adapters::MultipartMixedRequest
Creates headers and a body for a multipart/mixed request with a file and a JSON body.
Attributes
multiparty[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/bambora/adapters/multipart_mixed_request.rb, line 10 def initialize(options = {}) @multiparty = Multiparty.new { |party| party.parts = options[:multipart_args] } end
Public Instance Methods
body()
click to toggle source
# File lib/bambora/adapters/multipart_mixed_request.rb, line 18 def body "#{multiparty.body}\r\n" end
content_type()
click to toggle source
# File lib/bambora/adapters/multipart_mixed_request.rb, line 14 def content_type multiparty.header.sub(/^Content-Type: /, '').strip end