Class: Coinbase::Correlation
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Coinbase::Correlation
- Defined in:
- lib/coinbase/correlation.rb
Overview
A middleware that injects correlation data into the request headers.
Instance Method Summary collapse
-
#call(env) ⇒ Object
Processes the request by adding the Correlation Data to the request headers.
- #correlation_data ⇒ Object
-
#initialize(app) ⇒ Correlation
constructor
Initializes the Correlation middleware.
Constructor Details
#initialize(app) ⇒ Correlation
Initializes the Correlation middleware.
11 12 13 14 |
# File 'lib/coinbase/correlation.rb', line 11 def initialize(app) super(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
Processes the request by adding the Correlation Data to the request headers.
18 19 20 21 |
# File 'lib/coinbase/correlation.rb', line 18 def call(env) env.request_headers['Correlation-Context'] = correlation_data @app.call(env) end |