Class: UssdEngine::Middleware::RequestId

Inherits:
Object
  • Object
show all
Defined in:
lib/ussd_engine/middleware/request_id.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RequestId

Returns a new instance of RequestId.



4
5
6
# File 'lib/ussd_engine/middleware/request_id.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
# File 'lib/ussd_engine/middleware/request_id.rb', line 8

def call(env)
  env["ussd_engine.request"][:id] = get_request_identifier(env) if env["ussd_engine.request"].present?
  @app.call(env)
end