class Object::Profiler::Middleware

Public Class Methods

new(app, options={}) click to toggle source
# File lib/object/profiler/middleware.rb, line 6
def initialize(app, options={})
  @app    = app
  @output = options[:output] ? File.open(options[:output], 'w+') : STDOUT

end

Public Instance Methods

call(env) click to toggle source
# File lib/object/profiler/middleware.rb, line 12
def call(env)
  Object::Profiler.track(@output) { 
    @app.call(env)
  }
end