Class: Exceptify::SnsNotifier
- Inherits:
-
BaseNotifier
- Object
- BaseNotifier
- Exceptify::SnsNotifier
- Defined in:
- lib/exceptify/sns_notifier.rb
Instance Attribute Summary
Attributes inherited from BaseNotifier
Instance Method Summary collapse
- #call(exception, custom_opts = {}) ⇒ Object
-
#initialize(options) ⇒ SnsNotifier
constructor
A new instance of SnsNotifier.
Methods inherited from BaseNotifier
#_post_callback, #_pre_callback, #send_notice
Constructor Details
#initialize(options) ⇒ SnsNotifier
Returns a new instance of SnsNotifier.
5 6 7 8 9 10 11 |
# File 'lib/exceptify/sns_notifier.rb', line 5 def initialize() = .dup super @notifier = .delete(:client) || build_client() @options = .merge() end |
Instance Method Details
#call(exception, custom_opts = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/exceptify/sns_notifier.rb', line 13 def call(exception, custom_opts = {}) = .merge(custom_opts) notification = Notification.new(exception, ) subject = build_subject(notification, ) = (notification, ) notifier.publish( topic_arn: [:topic_arn], message: , subject: subject ) end |