class Restforce::Bulk::Parser::Xml

Public Instance Methods

batches(data) click to toggle source
# File lib/restforce/bulk/parser/xml.rb, line 5
def batches(data)
  parsed_data = Restforce::Mash.new(::MultiXml.parse(data))

  wrap_in_array(parsed_data.batchInfoList.batchInfo)
end
content_on(data) click to toggle source
# File lib/restforce/bulk/parser/xml.rb, line 19
def content_on(data)
  data.queryResult
end
results_on(data) click to toggle source
# File lib/restforce/bulk/parser/xml.rb, line 11
def results_on(data)
  if data.results
    wrap_in_array(data.results.result)
  else
    [{ id: data.result_list.result }]
  end
end

Protected Instance Methods

wrap_in_array(value) click to toggle source
# File lib/restforce/bulk/parser/xml.rb, line 25
def wrap_in_array(value)
  value.is_a?(Array) ? value : [value]
end