module ZendeskAPI::Destroy

Public Class Methods

included(klass) click to toggle source
# File lib/zendesk_api/actions.rb, line 220
def self.included(klass)
  klass.extend(ClassMethod)
end

Public Instance Methods

destroy(&block) click to toggle source

Destroys, returning false on error.

# File lib/zendesk_api/actions.rb, line 242
def destroy(&block)
  destroy!(&block)
rescue ZendeskAPI::Error::ClientError
  false
end
destroy!() { |req| ... } click to toggle source

If this resource hasn’t already been deleted, then do so. @return [Boolean] Successful?

# File lib/zendesk_api/actions.rb, line 231
def destroy!
  return false if destroyed? || new_record?

  @client.connection.delete(url || path) do |req|
    yield req if block_given?
  end

  @destroyed = true
end
destroyed?() click to toggle source

Has this object been deleted?

# File lib/zendesk_api/actions.rb, line 225
def destroyed?
  @destroyed ||= false
end