Class: Harbinger::Reporters::ExceptionReporter
- Inherits:
-
Object
- Object
- Harbinger::Reporters::ExceptionReporter
- Defined in:
- lib/harbinger/reporters/exception_reporter.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
- #accept(message) ⇒ Object
-
#initialize(exception) ⇒ ExceptionReporter
constructor
A new instance of ExceptionReporter.
Constructor Details
#initialize(exception) ⇒ ExceptionReporter
Returns a new instance of ExceptionReporter.
5 6 7 |
# File 'lib/harbinger/reporters/exception_reporter.rb', line 5 def initialize(exception) @exception = exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
3 4 5 |
# File 'lib/harbinger/reporters/exception_reporter.rb', line 3 def exception @exception end |
Instance Method Details
#accept(message) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/harbinger/reporters/exception_reporter.rb', line 9 def accept() if exception.respond_to?(:class) .append('exception', 'class_name', exception.class.to_s) end if exception.respond_to?(:backtrace) .append('exception', 'backtrace', Array(exception.backtrace).join("\n")) end if exception.respond_to?(:message) .append('exception', 'message', exception.) end end |