Class: Specular::Integration::Slack
- Defined in:
- lib/specular/integration/slack.rb
Instance Method Summary collapse
-
#initialize(slack_token:, slack_channel:) ⇒ Slack
constructor
A new instance of Slack.
- #post_message!(message:) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(slack_token:, slack_channel:) ⇒ Slack
Returns a new instance of Slack.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/specular/integration/slack.rb', line 7 def initialize(slack_token:, slack_channel:) @slack_token = slack_token @slack_channel = slack_channel Slack::Web::Client.configure do |config| config.token = slack_token end @client = Slack::Web::Client.new end |
Instance Method Details
#post_message!(message:) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/specular/integration/slack.rb', line 18 def (message:) @client.chat_postMessage( channel: @slack_channel, text: ) end |