Class: Intake::ExceptionFormatter
- Inherits:
-
Object
- Object
- Intake::ExceptionFormatter
- Defined in:
- lib/intake/exception_formatter.rb
Overview
Base class that formats exception object to string
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
Returns the value of attribute backtrace.
-
#cause ⇒ Object
Returns the value of attribute cause.
Instance Method Summary collapse
-
#call(err) ⇒ Object
Formats error to string.
-
#initialize ⇒ ExceptionFormatter
constructor
A new instance of ExceptionFormatter.
Constructor Details
#initialize ⇒ ExceptionFormatter
Returns a new instance of ExceptionFormatter.
8 9 10 11 |
# File 'lib/intake/exception_formatter.rb', line 8 def initialize @backtrace = true @cause = true end |
Instance Attribute Details
#backtrace ⇒ Object
Returns the value of attribute backtrace.
6 7 8 |
# File 'lib/intake/exception_formatter.rb', line 6 def backtrace @backtrace end |
#cause ⇒ Object
Returns the value of attribute cause.
6 7 8 |
# File 'lib/intake/exception_formatter.rb', line 6 def cause @cause end |
Instance Method Details
#call(err) ⇒ Object
Formats error to string
14 15 16 |
# File 'lib/intake/exception_formatter.rb', line 14 def call(err) format(err, []).join("\n") end |