Sha256: c8322e32d86a1d5d2f361207f2aeeecde86ab781974a29426359a4360fe37eec

Contents?: true

Size: 347 Bytes

Versions: 3

Compression:

Stored size: 347 Bytes

Contents

require 'json'
require 'rest-client'

module Sm
  class PostSlackMessage
    def self.to(channel, msg, as_user, icon_emoji, api_url)
      RestClient.post(
        api_url,
        payload: {
          username: as_user,
          channel: channel,
          text: msg,
          icon_emoji: icon_emoji
        }.to_json
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sm-2.0.0 lib/sm/post_slack_message.rb
sm-1.0.0 lib/sm/post_slack_message.rb
sm-0.2.1 lib/sm/post_slack_message.rb