Sha256: 32e1bc3f113d6cc6f690954b4fca7b191d52f8c75ce7913805ff5aa7cac56f46

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pipe_rpc-2.5.0 lib/pipe_rpc/client_wrapper.rb