Class: Shaf::Middleware::RequestId
- Inherits:
-
Object
- Object
- Shaf::Middleware::RequestId
- Defined in:
- lib/shaf/middleware/request_id.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RequestId
constructor
A new instance of RequestId.
Constructor Details
#initialize(app) ⇒ RequestId
Returns a new instance of RequestId.
8 9 10 |
# File 'lib/shaf/middleware/request_id.rb', line 8 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 |
# File 'lib/shaf/middleware/request_id.rb', line 12 def call(env) env['REQUEST_ID'] = SecureRandom.uuid @app.call(env) end |