Sha256: 8a87414eef7a4d26bb241175392892e6c41d4b2cdfaca8a91cef2f1803b001fd

Contents?: true

Size: 394 Bytes

Versions: 1

Compression:

Stored size: 394 Bytes

Contents

require "slack_notify_simple/version"

require "json"

module SlackNotifySimple
  def self.call(url:, title:, message:, icon:)
    uri = URI(url)
contents = <<-EOS
@channel:
```
#{message}
```
EOS
    hash = {
      "payload"=> {
        "username"    => title,
        "text"        => contents,
        "icon_emoji"  => icon
      }.to_json
    }
    Net::HTTP.post_form(uri, hash)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slack_notify_simple-0.1.0 lib/slack_notify_simple.rb