'.. versionadded:: 1.3
When you add a traverser as described in
:ref:`changing_the_traverser`, it\'s convenient to continue to use the
:meth:`pyramid.request.Request.resource_url` API.  However, since the
way traversal is done may have been modified, the URLs that
``resource_url`` generates by default may be incorrect when resources
are returned by a custom traverser.
If you\'ve added a traverser, you can change how
:meth:`~pyramid.request.Request.resource_url` generates a URL for a
specific type of resource by calling this method.
The ``adapter`` argument represents a class that implements the
:class:`~pyramid.interfaces.IResourceURL` interface.  The class
constructor should accept two arguments in its constructor (the
resource and the request) and the resulting instance should provide
the attributes detailed in that interface (``virtual_path`` and
``physical_path``, in particular).
The ``resource_iface`` argument represents a class or interface that
the resource should possess for this url adapter to be used when
:meth:`pyramid.request.Request.resource_url` looks up a resource url
adapter.  If ``resource_iface`` is not passed, or it is passed as
``None``, the url adapter will be used for every type of resource.
See :ref:`changing_resource_url` for more information.'

@action_method
def add_resource_url_adapter(self, adapter, resource_iface=None):

    adapter = self.maybe_dotted(adapter)
    resource_iface = self.maybe_dotted(resource_iface)
    def register(resource_iface=resource_iface):
        if (resource_iface is None):
            resource_iface = Interface
        self.registry.registerAdapter(adapter, (resource_iface, Interface), IResourceURL)
    discriminator = ('resource    url    adapter', resource_iface)
    intr = self.introspectable('resource    url    adapters', discriminator, ('resource    url    adapter    for    resource    iface    %r' % resource_iface), 'resource    url    adapter')
    intr['adapter'] = adapter
    intr['resource_iface'] = resource_iface
    self.action(discriminator, register, introspectables=(intr,))
