Class: Desiru::Jobs::WebhookConfig
- Inherits:
-
Object
- Object
- Desiru::Jobs::WebhookConfig
- Defined in:
- lib/desiru/jobs/webhook_notifier.rb
Overview
Configuration for webhook notifications
Instance Attribute Summary collapse
-
#custom_headers ⇒ Object
Returns the value of attribute custom_headers.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#events ⇒ Object
Returns the value of attribute events.
-
#include_payload ⇒ Object
Returns the value of attribute include_payload.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ WebhookConfig
constructor
A new instance of WebhookConfig.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ WebhookConfig
Returns a new instance of WebhookConfig.
128 129 130 131 132 133 134 135 |
# File 'lib/desiru/jobs/webhook_notifier.rb', line 128 def initialize @enabled = false @url = nil @secret = nil @events = %i[completed failed] # Which events to notify on @include_payload = true # Include job result in webhook @custom_headers = {} end |
Instance Attribute Details
#custom_headers ⇒ Object
Returns the value of attribute custom_headers.
126 127 128 |
# File 'lib/desiru/jobs/webhook_notifier.rb', line 126 def custom_headers @custom_headers end |
#enabled ⇒ Object
Returns the value of attribute enabled.
126 127 128 |
# File 'lib/desiru/jobs/webhook_notifier.rb', line 126 def enabled @enabled end |
#events ⇒ Object
Returns the value of attribute events.
126 127 128 |
# File 'lib/desiru/jobs/webhook_notifier.rb', line 126 def events @events end |
#include_payload ⇒ Object
Returns the value of attribute include_payload.
126 127 128 |
# File 'lib/desiru/jobs/webhook_notifier.rb', line 126 def include_payload @include_payload end |
#secret ⇒ Object
Returns the value of attribute secret.
126 127 128 |
# File 'lib/desiru/jobs/webhook_notifier.rb', line 126 def secret @secret end |
#url ⇒ Object
Returns the value of attribute url.
126 127 128 |
# File 'lib/desiru/jobs/webhook_notifier.rb', line 126 def url @url end |
Instance Method Details
#valid? ⇒ Boolean
137 138 139 |
# File 'lib/desiru/jobs/webhook_notifier.rb', line 137 def valid? enabled && url && !url.empty? end |