Class: Alerty::Plugin::Slack::SlackClient::Slackbot
- Defined in:
- lib/alerty/plugin/slack/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.
153 154 155 |
# File 'lib/alerty/plugin/slack/slack_client.rb', line 153 def initialize(endpoint, https_proxy = nil) super end |
Instance Method Details
#api ⇒ Object
157 158 159 |
# File 'lib/alerty/plugin/slack/slack_client.rb', line 157 def api @api ||= WebApi.new(nil, https_proxy) end |
#post_message(params = {}, opts = {}) ⇒ Object
161 162 163 164 165 166 167 |
# File 'lib/alerty/plugin/slack/slack_client.rb', line 161 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 |