Class: Coverband::BackgroundMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/coverband/integrations/background_middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ BackgroundMiddleware

Returns a new instance of BackgroundMiddleware.



5
6
7
# File 'lib/coverband/integrations/background_middleware.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
# File 'lib/coverband/integrations/background_middleware.rb', line 9

def call(env)
  @app.call(env)
ensure
  AtExit.register
  Background.start if Coverband.configuration.background_reporting_enabled
end