Class: StatusCat::Checkers::Slack

Inherits:
Base
  • Object
show all
Defined in:
lib/status_cat/checkers/slack.rb

Constant Summary

Constants inherited from Base

Base::FORMAT

Instance Attribute Summary

Attributes inherited from Base

#status, #value

Instance Method Summary collapse

Methods inherited from Base

class_to_name, #name, #to_s

Constructor Details

#initializeSlack

Returns a new instance of Slack.



5
6
7
8
9
10
11
12
13
# File 'lib/status_cat/checkers/slack.rb', line 5

def initialize
  return if gem_missing?('slack-ruby-client', defined?(::Slack))

  @value = ::Slack.config.token
  @status = fail_on_exception do
    message = ::Slack::Web::Client.new.auth_test
    message.ok? ? nil : message.to_s
  end
end