Sha256: 847a2a5e5ae830e6bfaac10eb71be72e1f963dc02dc37597a22511e1b61d8b32

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

module PipeRpc
  class Client < BasicInterface
    def initialize(server_id = :default, hub)
      @__rpc_server_id__ = server_id.to_sym
      @hub = hub
    end

    attr_reader :__rpc_server_id__

    def respond_to?(method)
      super or method_missing(:respond_to?, method)
    end

    def method_missing(method, *args)
      request = Client::Request.new(@hub, server: @__rpc_server_id__, method: method, arguments: args)
      @hub.requests.evaluate(request)
    end

    def to_s
      "<Client:#{@__rpc_server_id__}>"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pipe_rpc-2.1.0 lib/pipe_rpc/client.rb