Class: Arachni::RPC::Response

Inherits:
Message show all
Defined in:
lib/arachni/rpc/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: Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Message

#merge!, #prepare_for_tx

Constructor Details

- (Response) initialize

A new instance of Response

See Also:



55
56
57
58
59
# File 'lib/arachni/rpc/response.rb', line 55

def initialize( * )
    super

    @async = false
end

Instance Attribute Details

- (Object) obj

Return object of the Arachni::RPC::Request#message.

If there was an exception it will hold a Hash like:

{
    "exception" => "Trying to access non-existent object 'blah'.",
    "backtrace" => [
        [0] "/home/zapotek/workspace/arachni-rpc/lib/arachni/rpc/server.rb:285:in `call'",
        [1] "/home/zapotek/workspace/arachni-rpc/lib/arachni/rpc/server.rb:85:in `block in receive_object'",
        [2] "/home/zapotek/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:1009:in `call'",
        [3] "/home/zapotek/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:1009:in `block in spawn_threadpool'"
    ],
         "type" => "InvalidObject"
}

For all available exception types look at Exceptions.

Returns:



52
53
54
# File 'lib/arachni/rpc/response.rb', line 52

def obj
  @obj
end

Instance Method Details

- (Object) async!



65
66
67
# File 'lib/arachni/rpc/response.rb', line 65

def async!
    @async = true
end

- (Boolean) async?

Returns:

  • (Boolean)


61
62
63
# File 'lib/arachni/rpc/response.rb', line 61

def async?
    @async
end