Class: HeyYou::Channels::Slack
- Inherits:
-
Base
- Object
- Base
- HeyYou::Channels::Slack
- Defined in:
- lib/hey_you/channels/slack.rb
Defined Under Namespace
Classes: WebhookError
Constant Summary collapse
- WEBHOOK_ERR_MSG_TMPL =
"slack webhook `%{key}` was not configured".freeze
Class Method Summary collapse
Class Method Details
.send!(builder, **options) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/hey_you/channels/slack.rb', line 12 def send!(builder, **) raise CredentialsNotExists unless credentials_present? if [:to]&.is_a?(String) || [:to]&.is_a?(Symbol) return send_to_webhook(builder, **) end if builder.slack&.webhook_name .delete(:to) return send_to_webhook(builder, **) end send_to_multiple_webhooks(builder, **) end |