Class: RequestTracer::Integration::RackHandler

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/request_tracer/integration/rack_handler.rb

Constant Summary

Constants included from Base

Base::HEADER_REGEX

Instance Method Summary collapse

Methods included from Base

#extract_fields_from_headers, #extract_headers_from_fields

Constructor Details

#initialize(app, config = {}) ⇒ RackHandler

Returns a new instance of RackHandler.



7
8
9
10
# File 'lib/request_tracer/integration/rack_handler.rb', line 7

def initialize(app, config={})
  @app = app
  @tracer = config[:tracer] || Trace
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
# File 'lib/request_tracer/integration/rack_handler.rb', line 11

def call(env)
  @tracer.push(extract_fields_from_headers(env)) do
    @app.call(env)
  end
end