Class: Rack::Analytics::RequestLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/analytics/request_logger.rb

Instance Method Summary collapse

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, options = {}
  @app = app
  @options = options
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