class RequestInfo::DetectorApp

Rack middleware to process all specified detectors and sets results for the current thread

Constants

DEFAULT_DETECTORS

TODO: make this list of detectors available for others to add/change

Attributes

detectors[RW]
analyzer[R]
app[R]

Public Class Methods

new(app) click to toggle source
# File lib/request_info/detector_app.rb, line 27
def initialize(app)
  @app = app
  @analyzer = EnvAnalyzer.new(self.class.detectors || DEFAULT_DETECTORS)
end

Public Instance Methods

call(env) click to toggle source
# File lib/request_info/detector_app.rb, line 32
def call(env)
  analyzer.analyze(env)
  analyzer.wrap_app do
    app.call(env)
  end
end