Class: Stackprofiler::Middleware

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

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ Middleware

Returns a new instance of Middleware.



3
4
5
6
7
8
9
10
11
# File 'lib/stackprofiler/middleware.rb', line 3

def initialize(app, options = {})
  mid = Rack::Builder.new do
    use Rack::Deflater
    run WebUI
  end

  @app = Rack::URLMap.new({'/__stackprofiler' => mid, '/' => DataCollector.new(app, options)})
  @options = options
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
# File 'lib/stackprofiler/middleware.rb', line 13

def call(env)
  @app.call env
end