Module: SlackErrorNotifier
- Extended by:
- Configuration
- Defined in:
- lib/slack_error_notifier.rb,
lib/slack_error_notifier/version.rb,
lib/slack_error_notifier/slack_notification.rb,
lib/slack_error_notifier/slack_configuration.rb
Defined Under Namespace
Modules: ConfigurationError
Classes: SlackConfiguration, SlackNotification
Constant Summary
collapse
- VERSION =
"0.1.2"
Class Method Summary
collapse
configuration, define_setting
Class Method Details
.check_configuration(block_given) ⇒ Object
26
27
28
|
# File 'lib/slack_error_notifier.rb', line 26
def self.configure_slack_client
@slack_configuration = SlackConfiguration.new
end
|
.send_notification(error) ⇒ Object
34
35
36
|
# File 'lib/slack_error_notifier.rb', line 34
def self.send_notification(error)
SlackNotification.send(error)
end
|
.slack_client ⇒ Object
30
31
32
|
# File 'lib/slack_error_notifier.rb', line 30
def self.slack_client
@slack_configuration.slack_client
end
|
.with_notifications ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'lib/slack_error_notifier.rb', line 17
def self.with_notifications
check_configuration(block_given?)
configure_slack_client
yield
rescue => error
puts "Encountered #{error}. Sending Notification to #{target_channel}."
send_notification(error)
end
|