Class: ExceptionNotifier::DetailedSlackNotifier::DetailedSlackNotification
- Inherits:
-
Object
- Object
- ExceptionNotifier::DetailedSlackNotifier::DetailedSlackNotification
- Defined in:
- lib/exception_notifier/detailed_slack_notifier.rb
Overview
this class builds Slack exception notifications
Instance Method Summary collapse
- #attachments ⇒ Object
-
#initialize(exception, options = {}) ⇒ DetailedSlackNotification
constructor
A new instance of DetailedSlackNotification.
- #message ⇒ Object
Constructor Details
#initialize(exception, options = {}) ⇒ DetailedSlackNotification
Returns a new instance of DetailedSlackNotification.
27 28 29 30 31 32 |
# File 'lib/exception_notifier/detailed_slack_notifier.rb', line 27 def initialize(exception, = {}) @exception = exception @env = [:env] @data = ((env && env['exception_notifier.exception_data']) || {}).merge([:data] || {}) @timestamp = Time.zone.now end |
Instance Method Details
#attachments ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/exception_notifier/detailed_slack_notifier.rb', line 41 def array = [] unless background_exception? array << array << end array << array << end |
#message ⇒ Object
34 35 36 37 38 39 |
# File 'lib/exception_notifier/detailed_slack_notifier.rb', line 34 def msg = "#{exception.class.to_s =~ /^[aeiou]/i ? 'An' : 'A'} #{exception.class} occurred" msg << "#{background_exception? ? ' in background' : ''} at #{} :\n" msg << "#{exception.}\n" msg end |