class PipeRpc::Request; end module PipeRpc class Client::Request < Request def initialize(hub, request) @hub = hub request[:arguments] = hub.transport_mapper.to_transport request[:arguments] super request # discard first three entries mentioning Client::Request#initialize, # Client::Request.new and Client#method_missing in stacktrace @stacktrace = Kernel.respond_to?(:caller) ? Kernel.caller(3).to_a : [] @result = Result.new(self) end attr_reader :hub, :stacktrace, :result def id=(id) raise 'id already set' if @id @id = id end def id @id or raise 'id not set' end end end