Class: Exceptions::Backends::Context

Inherits:
Exceptions::Backend show all
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

Instance Method Summary collapse

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

#backendObject (readonly)

Returns the value of attribute backend.



6
7
8
# File 'lib/exceptions/backends/context.rb', line 6

def backend
  @backend
end

#extraObject (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