Exposes all public methods of a class instance. Args: instance: The instance to register.
(self, instance: Any)
| 193 | logger_debug(f"[server] Registered function: {fname}") |
| 194 | |
| 195 | def register_instance(self, instance: Any) -> None: |
| 196 | """Exposes all public methods of a class instance. |
| 197 | |
| 198 | Args: |
| 199 | instance: The instance to register. |
| 200 | """ |
| 201 | logger_debug( |
| 202 | f"[server] Registering instance of class: {instance.__class__.__name__}" |
| 203 | ) |
| 204 | for name in dir(instance): |
| 205 | if not name.startswith('_'): |
| 206 | attr = getattr(instance, name) |
| 207 | if callable(attr): |
| 208 | self.register_function(attr, name) |
| 209 | |
| 210 | def get_attr(self, name: str) -> Any: |
| 211 | """ Get the attribute of the RPC server. |
no test coverage detected