class AutoBrewster::Middleware

Attributes

error[RW]

Public Class Methods

new(app) click to toggle source
# File lib/auto_brewster/middleware.rb, line 5
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/auto_brewster/middleware.rb, line 9
def call(env)
  if env["PATH_INFO"] == "/__identify__"
    [200, {}, [@app.object_id.to_s]]
  else
    begin
      @app.call(env)
    rescue StandardError => e
      @error = e unless @error
      raise e
    end
  end
end