class Sinatra::Base

def new(*args, &bk)

an instance of the class new was called on.
pipeline. The object is guaranteed to respond to #call but may not be
Create a new instance of the class fronted by its middleware
def new(*args, &bk)
  builder = Rack::Builder.new
  builder.use Rack::Session::Cookie if sessions?
  builder.use Rack::CommonLogger    if logging?
  builder.use Rack::MethodOverride  if method_override?
  builder.use ShowExceptions        if show_exceptions?
  middleware.each { |c,a,b| builder.use(c, *a, &b) }
  builder.run super
  builder.to_app
end