module PipeRpc module ClientWrappers; end class ClientWrapper < BasicInterface def initialize(gateway, client) @client = client @gateway = gateway end def inspect __rpc_server_id__ end alias to_s inspect def method_missing(method, *args) @client.__send__(method, *args) end end class << ClientWrapper def from_rpc_transport(gateway, client) if gateway.client_wrapper_class_namespace.const_defined?(client.__rpc_server_class_name__, false) gateway.client_wrapper_class_namespace.const_get(client.__rpc_server_class_name__, false).new(gateway, client) else client end end end end