Class: Bugwatch::Notification
- Inherits:
-
Object
- Object
- Bugwatch::Notification
- Defined in:
- lib/bugwatch/notification.rb
Constant Summary collapse
- TIMEOUT =
3
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(payload, config: Bugwatch.configuration) ⇒ Notification
constructor
A new instance of Notification.
Constructor Details
#initialize(payload, config: Bugwatch.configuration) ⇒ Notification
Returns a new instance of Notification.
9 10 11 12 |
# File 'lib/bugwatch/notification.rb', line 9 def initialize(payload, config: Bugwatch.configuration) @payload = payload @config = config end |
Instance Method Details
#deliver ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bugwatch/notification.rb', line 14 def deliver return unless @config.api_key return unless @config.endpoint return unless @config.notify_for_release_stage? Thread.new do post_to_api rescue StandardError # Fire-and-forget: swallow all errors so the gem never affects the app end end |