Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/arachni/ruby/object.rb
Overview
Overloads the Object class providing a #deep_clone method.
Instance Method Summary collapse
-
#deep_clone ⇒ Object
Deep-clones self using a Marshal dump-load.
- #rpc_clone ⇒ Object
- #to_rpc_data_or_self ⇒ Object
Instance Method Details
#deep_clone ⇒ Object
Deep-clones self using a Marshal dump-load.
18 19 20 |
# File 'lib/arachni/ruby/object.rb', line 18 def deep_clone Marshal.load( Marshal.dump( self ) ) end |
#rpc_clone ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/arachni/ruby/object.rb', line 22 def rpc_clone if self.class.respond_to?( :from_rpc_data ) self.class.from_rpc_data( Arachni::RPC::Serializer.serializer.load( Arachni::RPC::Serializer.serializer.dump( to_rpc_data_or_self ) ) ) else Arachni::RPC::Serializer.serializer.load( Arachni::RPC::Serializer.serializer.dump( self ) ) end end |
#to_rpc_data_or_self ⇒ Object
36 37 38 |
# File 'lib/arachni/ruby/object.rb', line 36 def to_rpc_data_or_self respond_to?( :to_rpc_data ) ? to_rpc_data : self end |