Class: ContextIO::Lite::Webhook

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

Instance Attribute Summary

Attributes included from API::Resource

#api, #api_attributes, #primary_key, #resource_url, #with_constraints

Instance Method Summary collapse

Methods included from API::Resource

#initialize, #with

Instance Method Details

#activateObject



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

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

#active?Boolean

Returns:

  • (Boolean)


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

def active?
  !!active
end

#deactivateObject



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

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

#deleteObject



38
39
40
# File 'lib/contextio/lite/webhook.rb', line 38

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

#failure?Boolean

Returns:

  • (Boolean)


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

def failure?
  !!failure
end