class Sinatra::Base

def middleware

Middleware used in this class and all superclasses.
def middleware
  if superclass.respond_to?(:middleware)
    superclass.middleware + @middleware
  else
    @middleware
  end
end