Sha256: 27ed01eaebb41b8620a38a3e941428c692e5dfdd05e8a35d31eb8a4014f3890e
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true require('trailblazer/operation') require('trailblazer/macro') module ConsoleTracker module Slack class ComposeMessage < Trailblazer::Operation step :text step :attachment step :command_field step :message_params def text(ctx, username:, **) ctx[:text] = "*DEVELOPER: _#{username}_*" end def attachment(ctx, **) ctx[:attachment] = { fields: [], color: '#e74c3c', footer: 'Console spy', footer_icon: 'https://drivy-prod-static.s3.amazonaws.com/slack/spy-small.png', ts: Time.zone.now.to_i, mrkdwn_in: ['fields'] } end def command_field(_ctx, attachment:, command:, **) attachment[:fields] << { title: 'Command', value: "```#{command}```", short: false } end def message_params(ctx, attachment:, text:, **) ctx[:message_params] = { text: text, attachments: [attachment] } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
console_tracker-0.0.0.pre.beta3 | lib/console_tracker/loggers/slack/compose_message.rb |
console_tracker-0.0.0.pre.beta2 | lib/console_tracker/loggers/slack/compose_message.rb |