summaryrefslogtreecommitdiff
path: root/app/models/project_services/slack_messages/slack_base_message.rb
blob: c2fc27884bf91be495f159517ed3c53d57e4d64f (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'

module SlackMessages
  class SlackBaseMessage
    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