Module: ZendeskAPI::Destroy::ClassMethod

Defined in:
lib/zendesk_api/actions.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) destroy(client, opts = {})

Deletes a resource given the id passed in.

Parameters:

  • client (Client)

    The Client object to be used

  • opts (Hash) (defaults to: {})

    The optional parameters to pass. Defaults to {}



162
163
164
165
166
167
168
169
170
171
# File 'lib/zendesk_api/actions.rb', line 162

def destroy(client, opts = {})
  @client = client # so we can use client.logger in rescue
  association = opts.delete(:association) || Association.new(:class => self)

  client.connection.delete(association.generate_path(opts)) do |req|
    req.params = opts
  end

  true
end