Class: RequestTracer::Integration::RackHandler
- Inherits:
-
Object
- Object
- RequestTracer::Integration::RackHandler
- Includes:
- Base
- Defined in:
- lib/request_tracer/integration/rack_handler.rb
Constant Summary
Constants included from Base
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, config = {}) ⇒ RackHandler
constructor
A new instance of RackHandler.
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 |