Module: FatZebra::APIOperation::Delete

Included in:
Batch, Customer, DirectCredit, DirectDebit, PaymentPlan, WebHook
Defined in:
lib/fat_zebra/api_operation/delete.rb

Overview

Delete a resource for the API

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



34
35
36
# File 'lib/fat_zebra/api_operation/delete.rb', line 34

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#destroy(options = {}) ⇒ FatZebra::Object

Delete an API Resources

Parameters:

  • Additional (Hash)

    options for the request

Returns:

  • (FatZebra::Object)

    response from the API



29
30
31
32
# File 'lib/fat_zebra/api_operation/delete.rb', line 29

def destroy(options = {})
  response = request(:delete, "#{resource_path}/#{id}", {}, options)
  update_from(response)
end