Sha256: 15a8847fc766273a0b19b700c77142e7d5d6da59e34ac975273355914ee04eaa

Contents?: true

Size: 672 Bytes

Versions: 2

Compression:

Stored size: 672 Bytes

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

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