Class: ContextIO::Webhook

Inherits:
Object
  • Object
show all
Includes:
API::Resource
Defined in:
lib/contextio/webhook.rb

Instance Attribute Summary

Attributes included from API::Resource

#api_attributes, #primary_key, #resource_url

Instance Method Summary collapse

Instance Method Details

#activateObject



27
28
29
# File 'lib/contextio/webhook.rb', line 27

def activate
  api.request(:post, resource_url, active: 1)['success']
end

#active?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/contextio/webhook.rb', line 19

def active?
  !!active
end

#deactivateObject



31
32
33
# File 'lib/contextio/webhook.rb', line 31

def deactivate
  api.request(:post, resource_url, active: 0)['success']
end

#deleteObject



35
36
37
# File 'lib/contextio/webhook.rb', line 35

def delete
  api.request(:delete, resource_url)['success']
end

#failure?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/contextio/webhook.rb', line 23

def failure?
  !!failure
end