Sha256: f06e616a6672e9b3128bd077b73328f4614c4eccaf67be9c95b120862fa61caf

Contents?: true

Size: 910 Bytes

Versions: 1

Compression:

Stored size: 910 Bytes

Contents

module PipeRpc
  module SubjectServers; end

  class SubjectServer < Server
    def initialize(server_subject)
      @server_subject = server_subject
    end

    def __rpc_server_class_name__
      if @server_subject.respond_to? :__rpc_server_class_name__
        @server_subject.__rpc_server_class_name__
      elsif @server_subject.is_a? Module
        @server_subject.to_s
      else
        @server_subject.class.to_s
      end
    end

    def __rpc_server_instance_id__
      if @server_subject.respond_to? :rpc_server_instance_id
        @server_subject.rpc_server_instance_id
      elsif @server_subject.is_a? Module
        nil
      else
        @server_subject.__id__.to_s
      end
    end
  end

  class << SubjectServer
    def from_rpc_transport(gateway, server)
      if self === server
        instance_eval_for(server, '@server_subject')
      else
        server
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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