rbtools.api.decorators¶
Functions
Wrap a method returned from a resource to capture HttpRequests. |
- rbtools.api.decorators.request_method_decorator(f)[source]¶
Wrap a method returned from a resource to capture HttpRequests.
When a method which returns HttpRequests is called, it will pass the method and arguments off to the transport to be executed.
This wrapping allows the transport to skim arguments off the top of the method call, and modify any return values (such as executing a returned HttpRequest).
However, if called with the
internal
argument set to True, the method itself will be executed and the value returned as-is. Thus, any method calls embedded inside the code for another method should use theinternal
argument to access the expected value.