Sha256: a01c1c5eeeb20bd2b4f1ff3be076b0c72bfda7dbd375d09c7407e508d6a64326

Contents?: true

Size: 614 Bytes

Versions: 4

Compression:

Stored size: 614 Bytes

Contents

module PipeRpc
  class Hub::Server < BasicInterface
    kernel = ::Kernel.dup
    kernel.class_eval do
      alias_method :__rpc_server_class__, :class
      (instance_methods - [:__rpc_server_class__, :object_id]).each{ |m| remove_method m }
      private_instance_methods.each{ |m| remove_method m } if respond_to? :private_instance_methods
    end
    include kernel

    SERVER_ID_GETTER = :__id__

    def self.const_missing(name)
      ::Object.const_get(name)
    end

    def to_rpc_server_id
      "#{__rpc_server_class__.to_s}##{__send__(__rpc_server_class__::SERVER_ID_GETTER)}".to_sym
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pipe_rpc-2.2.3 lib/pipe_rpc/hub_server.rb
pipe_rpc-2.2.2 lib/pipe_rpc/hub_server.rb
pipe_rpc-2.2.1 lib/pipe_rpc/hub_server.rb
pipe_rpc-2.2.0 lib/pipe_rpc/hub_server.rb