class Sinatra::Base
def compile!(verb, path, block, options = {})
def compile!(verb, path, block, options = {}) options.each_pair { |option, args| send(option, *args) } method_name = "#{verb} #{path}" define_method(method_name, &block) unbound_method = instance_method method_name pattern, keys = compile(path) conditions, @conditions = @conditions, [] remove_method method_name [ block.arity != 0 ? proc { unbound_method.bind(self).call(*@block_params) } : proc { unbound_method.bind(self).call }, pattern, keys, conditions ] end