Class: Exceptions::Backends::Context
- Inherits:
-
Exceptions::Backend
- Object
- Exceptions::Backend
- Exceptions::Backends::Context
- Defined in:
- lib/exceptions/backends/context.rb
Overview
Public: Context is a middleware that will add the given context options whenever an exception is reported.
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#extra ⇒ Object
readonly
Returns the value of attribute extra.
Instance Method Summary collapse
- #clear_context(*args) ⇒ Object
- #context(*args) ⇒ Object
-
#initialize(backend, context = {}) ⇒ Context
constructor
A new instance of Context.
- #notify(exception, *args) ⇒ Object
Constructor Details
#initialize(backend, context = {}) ⇒ Context
Returns a new instance of Context.
8 9 10 11 |
# File 'lib/exceptions/backends/context.rb', line 8 def initialize(backend, context = {}) @backend = backend @extra = context end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
6 7 8 |
# File 'lib/exceptions/backends/context.rb', line 6 def backend @backend end |
#extra ⇒ Object (readonly)
Returns the value of attribute extra.
6 7 8 |
# File 'lib/exceptions/backends/context.rb', line 6 def extra @extra end |
Instance Method Details
#clear_context(*args) ⇒ Object
22 23 24 |
# File 'lib/exceptions/backends/context.rb', line 22 def clear_context(*args) backend.clear_context(*args) end |
#context(*args) ⇒ Object
18 19 20 |
# File 'lib/exceptions/backends/context.rb', line 18 def context(*args) backend.context(*args) end |
#notify(exception, *args) ⇒ Object
13 14 15 16 |
# File 'lib/exceptions/backends/context.rb', line 13 def notify(exception, *args) backend.context extra backend.notify(exception, *args) end |