Class: Rack::Analytics::RequestLogger
- Inherits:
-
Object
- Object
- Rack::Analytics::RequestLogger
- Defined in:
- lib/rack/analytics/request_logger.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ RequestLogger
constructor
A new instance of RequestLogger.
Constructor Details
#initialize(app, options = {}) ⇒ RequestLogger
Returns a new instance of RequestLogger.
6 7 8 9 |
# File 'lib/rack/analytics/request_logger.rb', line 6 def initialize app, = {} @app = app = end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 |
# File 'lib/rack/analytics/request_logger.rb', line 11 def call env Rack::Analytics.queue << env if env['REQUEST_METHOD'] == 'GET' @app.call(env) end |