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

base_message.rb « slack_service « project_services « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aa00d6061a118473758411a0b7581836ff9db291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'slack-notifier'

class SlackService
  class BaseMessage
    def initialize(params)
      raise NotImplementedError
    end

    def pretext
      format(message)
    end

    def attachments
      raise NotImplementedError
    end

    private

    def message
      raise NotImplementedError
    end

    def format(string)
      Slack::Notifier::LinkFormatter.format(string)
    end

    def attachment_color
      '#345'
    end
  end
end