class Restforce::Bulk::Builder::ZipXml

Public Instance Methods

create_request_txt(data) click to toggle source
# File lib/restforce/bulk/builder/zip_xml.rb, line 10
def create_request_txt(data)
  build_xml(:sObjects, "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance") do |xml|
    data.each do |item|
      xml.sObject do
        xml.Name item[:filename]
        xml.ParentId item[:parent_id]
        xml.Body "##{item[:filename]}"
      end
    end
  end
end
transform(data, operation, content_type) click to toggle source
# File lib/restforce/bulk/builder/zip_xml.rb, line 5
def transform(data, operation, content_type)
  zipper = Restforce::Bulk::Zipper.new(data, content_type)
  File.read(zipper.zip)
end