Sha256: 50cd5e103df34aa61a0ae11cf4d5ec8c8a362be07b20d513cf0704c013e08830

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

module PipeRpc
  class Client < BasicObject
    undef_method :instance_eval unless ::Object.const_defined?(:MRUBY_VERSION)
    undef_method :instance_exec unless ::Object.const_defined?(:MRUBY_VERSION)

    def initialize(server = :default, hub)
      @server = server.to_sym
      @hub = hub
    end

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

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

    def is_a?(object)
      object == Client
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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