execute

in lib/facebook_ads/batch_api/batch.rb [32:51]


    def execute
      return [] if operations.empty?
      operations.each_slice(50) do |slice|
        api_response = APIRequest.new(:post, '', session: session, params: batch_args(slice)).execute_now
        self.last_api_response = api_response
        slice.zip(api_response.result).map do |req, res|
          next unless res

          begin
            req.create_response(
                res['code'],
                convert_headers_to_hash(res['headers']),
                res['body'])
          rescue APIError => e
            e
          end
        end
      end
    end