Class: Object

Inherits:
BasicObject
Defined in:
lib/arachni/ruby/object.rb

Overview

Overloads the Object class providing a #deep_clone method.

Author:

Instance Method Summary collapse

Instance Method Details

#deep_cloneObject

Deep-clones self using a Marshal dump-load.

Returns:

  • (Object)

    Duplicate of self.



18
19
20
# File 'lib/arachni/ruby/object.rb', line 18

def deep_clone
    Marshal.load( Marshal.dump( self ) )
end

#to_rpc_data_or_selfObject



22
23
24
# File 'lib/arachni/ruby/object.rb', line 22

def to_rpc_data_or_self
    respond_to?( :to_rpc_data ) ? to_rpc_data : self
end