Class: PostSlackMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/sm/post_slack_message.rb

Class Method Summary collapse

Class Method Details

.to(channel, msg, as_user, icon_emoji, api_url) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/sm/post_slack_message.rb', line 4

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