'Converts the class into an actual view function that can be used
with the routing system.  Internally this generates a function on the
fly which will instantiate the :class:`View` on each request and call
the :meth:`dispatch_request` method on it.
The arguments passed to :meth:`as_view` are forwarded to the
constructor of the class.'

@classmethod
def as_view(cls, name, *class_args, **class_kwargs):

    def view(*args, **kwargs):
        self = view.view_class(*class_args, **class_kwargs)
        return self.dispatch_request(*args, **kwargs)
    if cls.decorators:
        view.__name__ = name
        view.__module__ = cls.__module__
        for decorator in cls.decorators:
            view = decorator(view)
    view.view_class = cls
    view.__name__ = name
    view.__doc__ = cls.__doc__
    view.__module__ = cls.__module__
    view.methods = cls.methods
    view.provide_automatic_options = cls.provide_automatic_options
    return view
