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