Class: Faraday::RequestId
- Inherits:
-
Middleware
- Object
- Middleware
- Faraday::RequestId
- Defined in:
- lib/faraday/request_id.rb
Constant Summary collapse
- HEADER =
'X-Request-Id'.freeze
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = nil) ⇒ RequestId
constructor
A new instance of RequestId.
Constructor Details
#initialize(app, options = nil) ⇒ RequestId
Returns a new instance of RequestId.
8 9 10 11 |
# File 'lib/faraday/request_id.rb', line 8 def initialize(app, = nil) super(app) @options = || end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 |
# File 'lib/faraday/request_id.rb', line 13 def call(env) set_header(env) if needs_header?(env) @app.call(env) end |