Class: Layer::Webhook
- Extended by:
- Operations::Create::ClassMethods, Operations::Delete::ClassMethods, Operations::Find::ClassMethods, Operations::List::ClassMethods
- Defined in:
- lib/layer/webhook.rb
Overview
Note:
This is only available via the Platform API.
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
-
#activate! ⇒ Object
Activate this webhook.
-
#active? ⇒ Boolean
Check if this webhook is active.
-
#created_at ⇒ Time
Returns the time the webhook was created at.
-
#deactivate! ⇒ Object
Deactivate this webhook.
-
#inactive? ⇒ Boolean
Check if this webhook is inactive.
-
#unverified? ⇒ Boolean
Check if this webhook is unverified.
Methods included from Operations::Find::ClassMethods
Methods included from Operations::List::ClassMethods
Methods included from Operations::Create::ClassMethods
Methods included from Operations::Delete::ClassMethods
Methods included from Operations::Delete
Methods included from Operations::Find
Methods inherited from Resource
class_name, from_response, #id, #initialize, #respond_to_missing?, url, #url
Constructor Details
This class inherits a constructor from Layer::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Layer::Resource
Class Method Details
Instance Method Details
#activate! ⇒ Object
Activate this webhook
29 30 31 |
# File 'lib/layer/webhook.rb', line 29 def activate! client.post("#{url}/activate") end |
#active? ⇒ Boolean
Check if this webhook is active
46 47 48 |
# File 'lib/layer/webhook.rb', line 46 def active? status == 'active' end |
#created_at ⇒ Time
Returns the time the webhook was created at
58 59 60 |
# File 'lib/layer/webhook.rb', line 58 def created_at Time.parse(attributes['created_at']) end |
#deactivate! ⇒ Object
Deactivate this webhook
34 35 36 |
# File 'lib/layer/webhook.rb', line 34 def deactivate! client.post("#{url}/deactivate") end |
#inactive? ⇒ Boolean
Check if this webhook is inactive
52 53 54 |
# File 'lib/layer/webhook.rb', line 52 def inactive? status == 'inactive' end |
#unverified? ⇒ Boolean
Check if this webhook is unverified
40 41 42 |
# File 'lib/layer/webhook.rb', line 40 def unverified? status == 'unverified' end |