def METHOD_NAME(func_or_cls):
    endpoint = str(options.pop('endpoint', func_or_cls.__name__))
    if isinstance(func_or_cls, types.FunctionType):
        self.add_url_rule(rule, endpoint, func_or_cls, **options)
    else:
        self.add_url_rule(rule,
                          view_func=func_or_cls.as_view(endpoint),
                          **options)
    return func_or_cls