Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/microsoft_teams/notifier.rb')
-rw-r--r--lib/microsoft_teams/notifier.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/microsoft_teams/notifier.rb b/lib/microsoft_teams/notifier.rb
index 0b21c355a54..39005f56dcb 100644
--- a/lib/microsoft_teams/notifier.rb
+++ b/lib/microsoft_teams/notifier.rb
@@ -14,7 +14,7 @@ module MicrosoftTeams
response = Gitlab::HTTP.post(
@webhook.to_str,
headers: @header,
- body: body(options)
+ body: body(**options)
)
result = true if response
@@ -27,14 +27,13 @@ module MicrosoftTeams
private
- def body(options = {})
+ def body(title: nil, summary: nil, attachments: nil, activity:)
result = { 'sections' => [] }
- result['title'] = options[:title]
- result['summary'] = options[:summary]
- result['sections'] << MicrosoftTeams::Activity.new(options[:activity]).prepare
+ result['title'] = title
+ result['summary'] = summary
+ result['sections'] << MicrosoftTeams::Activity.new(**activity).prepare
- attachments = options[:attachments]
unless attachments.blank?
result['sections'] << { text: attachments }
end