class Sinatra::Base

def filter!(type, base = self.class)

Run filters defined on the class and all superclasses.
def filter!(type, base = self.class)
  filter! type, base.superclass if base.superclass.respond_to?(:filters)
  base.filters[type].each { |block| instance_eval(&block) }
end