Module: ZendeskAPI::DestroyMany

Included in:
GroupMembership, Organization, OrganizationMembership, Ticket, User
Defined in:
lib/zendesk_api/actions.rb

Instance Method Summary collapse

Instance Method Details

#destroy_many!(client, ids, association = Association.new(:class => self)) ⇒ JobStatus

Destroys multiple resources using the destroy_many endpoint.

Parameters:

  • client (Client)

    The Client object to be used

  • ids (Array)

    An array of ids to destroy

Returns:



272
273
274
275
276
277
278
279
280
# File 'lib/zendesk_api/actions.rb', line 272

def destroy_many!(client, ids, association = Association.new(:class => self))
  response = client.connection.delete("#{association.generate_path}/destroy_many") do |req|
    req.params = { :ids => ids.join(',') }

    yield req if block_given?
  end

  JobStatus.new_from_response(client, response)
end