class Jackal::Nellie::Formatter::SlackComment
Constants
- DESTINATION
Destination service
- SOURCE
Source service
Public Instance Methods
format(payload)
click to toggle source
Format payload to provide output comment to GitHub
@param payload [Smash]
# File lib/jackal-nellie/formatter/slack_comment.rb, line 19 def format(payload) if(payload.get(:data, :nellie, :result)) msgs = payload.fetch(:data, :slack, :messages, []) if(payload.get(:data, :nellie, :result, :complete)) msgs << Smash.new( :description => "#{app_config.fetch(:branding, :name, 'Nellie')} job result:", :message => success_message(payload), :color => :good ) else msgs << Smash.new( :description => "#{app_config.fetch(:branding, :name, 'Nellie')} job result:", :message => failure_message(payload), :color => :bad ) end payload.set(:data, :slack, :messages, msgs) end end