Class: Toq::Response

Inherits:
Message show all
Defined in:
lib/toq/response.rb

Overview

Represents an RPC response.

It’s here only for formalization purposes, it’s not actually sent over the wire.

What is sent is a hash generated by Message#prepare_for_tx which is in the form of:

{
    # result of the RPC call
    'obj' => object
}

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Message

#initialize, #merge!, #prepare_for_tx

Constructor Details

This class inherits a constructor from Toq::Message

Instance Attribute Details

#exceptionHash

For all available exception types look at Exceptions.

Returns:

  • (Hash)

    "name" => "Trying to access non-existent object 'blah'.",
    "backtrace" => [
        [0] "/home/zapotek/workspace/arachni-rpc/lib/toq/server.rb:285:in `call'",
        [1] "/home/zapotek/workspace/arachni-rpc/lib/toq/server.rb:85:in `block in receive_object'",
    ],
    "type" => "InvalidObject"
    



41
42
43
# File 'lib/toq/response.rb', line 41

def exception
  @exception
end

#objObject

Return object of the Toq::Request#message.

Returns:



27
28
29
# File 'lib/toq/response.rb', line 27

def obj
  @obj
end

Instance Method Details

#async!Object



51
52
53
# File 'lib/toq/response.rb', line 51

def async!
    @async = true
end

#async?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/toq/response.rb', line 47

def async?
    !!@async
end

#exception?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/toq/response.rb', line 43

def exception?
    !!exception
end