Class: TrackerApi::Resources::Webhook

Inherits:
Object
  • Object
show all
Includes:
Shared::Base
Defined in:
lib/tracker_api/resources/webhook.rb

Defined Under Namespace

Classes: UpdateRepresenter

Instance Method Summary collapse

Methods included from Shared::Base

included

Instance Method Details

#deleteObject

Raises:

  • (ArgumentError)


23
24
25
26
27
# File 'lib/tracker_api/resources/webhook.rb', line 23

def delete
  raise ArgumentError, 'Can not delete a webhook with an unknown project_id.' if project_id.nil?

  Endpoints::Webhook.new(client).delete(self)
end

#saveObject

Save changes to an existing Webhook.

Raises:

  • (ArgumentError)


30
31
32
33
34
# File 'lib/tracker_api/resources/webhook.rb', line 30

def save
  raise ArgumentError, 'Can not update a webhook with an unknown project_id.' if project_id.nil?

  Endpoints::Webhook.new(client).update(self, UpdateRepresenter.new(Webhook.new(self.dirty_attributes)))
end