Class: Fluent::SlackClient::IncomingWebhook

Inherits:
Base
  • Object
show all
Defined in:
lib/fluent/plugin/slack_client.rb

Overview

Slack client for Incoming Webhook

Instance Attribute Summary collapse

Attributes inherited from Base

#debug_dev, #log

Instance Method Summary collapse

Methods inherited from Base

#post

Constructor Details

#initialize(endpoint) ⇒ IncomingWebhook

Returns a new instance of IncomingWebhook.

Parameters:

  • endpoint (String)

    Configure Incoming Webhook endpoint



50
51
52
53
# File 'lib/fluent/plugin/slack_client.rb', line 50

def initialize(endpoint)
  super()
  @endpoint = URI.parse(endpoint)
end

Instance Attribute Details

#endpointObject

Returns the value of attribute endpoint.



47
48
49
# File 'lib/fluent/plugin/slack_client.rb', line 47

def endpoint
  @endpoint
end

Instance Method Details

#post_message(params = {}, opts = {}) ⇒ Object



55
56
57
58
# File 'lib/fluent/plugin/slack_client.rb', line 55

def post_message(params = {}, opts = {})
  log.info { "out_slack: post_message #{params}" }
  post(endpoint, params)
end