Class: Stoplight::Sentry::Notifier
- Inherits:
-
Notifier::Base
- Object
- Notifier::Base
- Stoplight::Sentry::Notifier
- Defined in:
- lib/stoplight/sentry/notifier.rb
Overview
Instance Attribute Summary collapse
-
#formatter ⇒ Object
Returns the value of attribute formatter.
-
#options ⇒ Object
Returns the value of attribute options.
-
#sentry ⇒ Object
Returns the value of attribute sentry.
Instance Method Summary collapse
-
#initialize(sentry, formatter = nil, **options) ⇒ Notifier
constructor
A new instance of Notifier.
- #notify(light, from_color, to_color, error) ⇒ String
Constructor Details
Instance Attribute Details
#formatter ⇒ Object
Returns the value of attribute formatter.
17 18 19 |
# File 'lib/stoplight/sentry/notifier.rb', line 17 def formatter @formatter end |
#options ⇒ Object
Returns the value of attribute options.
21 22 23 |
# File 'lib/stoplight/sentry/notifier.rb', line 21 def @options end |
#sentry ⇒ Object
Returns the value of attribute sentry.
13 14 15 |
# File 'lib/stoplight/sentry/notifier.rb', line 13 def sentry @sentry end |
Instance Method Details
#notify(light, from_color, to_color, error) ⇒ String
37 38 39 40 41 42 43 |
# File 'lib/stoplight/sentry/notifier.rb', line 37 def notify(light, from_color, to_color, error) formatter.(light, from_color, to_color, error).tap do || .merge(backtrace: error&.backtrace).then do || sentry.(, **) end end end |