Class: Rack::RequestTimestamp
- Inherits:
-
Object
- Object
- Rack::RequestTimestamp
- Defined in:
- lib/rack/request_timestamp.rb,
lib/rack/request_timestamp/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RequestTimestamp
constructor
A new instance of RequestTimestamp.
Constructor Details
#initialize(app) ⇒ RequestTimestamp
Returns a new instance of RequestTimestamp.
5 6 7 |
# File 'lib/rack/request_timestamp.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 |
# File 'lib/rack/request_timestamp.rb', line 9 def call(env) env[:timestamp] = Time.now @app.call(env) end |