2015-02-19 05:02:57 +00:00
|
|
|
require 'slack-notifier'
|
|
|
|
|
2015-02-20 13:49:26 +00:00
|
|
|
class SlackService
|
|
|
|
class BaseMessage
|
2015-02-19 05:02:57 +00:00
|
|
|
def initialize(params)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def pretext
|
|
|
|
format(message)
|
|
|
|
end
|
|
|
|
|
2015-12-07 12:23:23 +00:00
|
|
|
def fallback
|
|
|
|
end
|
|
|
|
|
2015-02-19 05:02:57 +00:00
|
|
|
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
|