Class: Isolator::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/isolator/notifier.rb

Overview

Wrapper over different notifications methods (exceptions, logging, uniform notifier)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, backtrace = caller) ⇒ Notifier



8
9
10
11
# File 'lib/isolator/notifier.rb', line 8

def initialize(exception, backtrace = caller)
  @exception = exception
  @backtrace = backtrace
end

Instance Attribute Details

#backtraceObject (readonly)

Returns the value of attribute backtrace.



6
7
8
# File 'lib/isolator/notifier.rb', line 6

def backtrace
  @backtrace
end

#exceptionObject (readonly)

Returns the value of attribute exception.



6
7
8
# File 'lib/isolator/notifier.rb', line 6

def exception
  @exception
end

Instance Method Details

#callObject

Raises:



13
14
15
16
17
# File 'lib/isolator/notifier.rb', line 13

def call
  log_exception
  send_notifications if send_notifications?
  raise(exception.class, exception.message, filtered_backtrace) if raise_exceptions?
end