Sha256: ee338aaa526cfeb68ff46f7c9e1def780a32a7d4490c3a4fd41c456a0e063f5b

Contents?: true

Size: 505 Bytes

Versions: 2

Compression:

Stored size: 505 Bytes

Contents

module PipeRpc
  class Client::Request::Result
    def initialize(request)
      @request = request
    end

    def value=(result)
      @received = true
      @value = result
    end

    def received?
      @received
    end

    def value
      if @value.is_a? Exception
        @value.set_backtrace(@value.backtrace.to_a + @request.stacktrace) if @value.respond_to? :set_backtrace
        raise @value
      else
        @request.hub.transport_mapper.from_transport @value
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pipe_rpc-2.5.0 lib/pipe_rpc/client_request_result.rb
pipe_rpc-2.4.0 lib/pipe_rpc/client_request_result.rb