Module: Gitlab::Chat::Responder
- Defined in:
- lib/gitlab/chat/responder.rb,
lib/gitlab/chat/responder/base.rb,
lib/gitlab/chat/responder/slack.rb,
lib/gitlab/chat/responder/mattermost.rb
Defined Under Namespace
Classes: Base, Mattermost, Slack
Class Method Summary collapse
-
.responder_for(build) ⇒ Object
Returns an instance of the responder to use for generating chat responses.
Class Method Details
.responder_for(build) ⇒ Object
Returns an instance of the responder to use for generating chat responses.
This method will return ‘nil` if no formatter is available for the given build.
build - A ‘Ci::Build` that executed a chat command.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gitlab/chat/responder.rb', line 13 def self.responder_for(build) response_url = build.pipeline.chat_data&.response_url return unless response_url if response_url.start_with?('https://hooks.slack.com/') Gitlab::Chat::Responder::Slack.new(build) else Gitlab::Chat::Responder::Mattermost.new(build) end end |