Class: Fluent::SlackClient::Slackbot
- Defined in:
- lib/fluent/plugin/slack_client.rb
Overview
Slack client for Slackbot Remote Control api.slack.com/slackbot
Instance Attribute Summary
Attributes inherited from Base
#debug_dev, #endpoint, #https_proxy, #log
Instance Method Summary collapse
- #api ⇒ Object
-
#initialize(endpoint, https_proxy = nil) ⇒ Slackbot
constructor
A new instance of Slackbot.
- #post_message(params = {}, opts = {}) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(endpoint, https_proxy = nil) ⇒ Slackbot
Returns a new instance of Slackbot.
161 162 163 |
# File 'lib/fluent/plugin/slack_client.rb', line 161 def initialize(endpoint, https_proxy = nil) super end |
Instance Method Details
#api ⇒ Object
165 166 167 |
# File 'lib/fluent/plugin/slack_client.rb', line 165 def api @api ||= WebApi.new(nil, https_proxy) end |
#post_message(params = {}, opts = {}) ⇒ Object
169 170 171 172 173 174 175 |
# File 'lib/fluent/plugin/slack_client.rb', line 169 def (params = {}, opts = {}) raise ArgumentError, "channel parameter is required" unless params[:channel] with_channels_create(params, opts) do log.info { "out_slack: post_message #{filter_params(params)}" } post(slackbot_endpoint(params), params) end end |