Sha256: 0e6e0b946fd628dc9ba679767ffa1b249ebb5c8ec0c0a9273a933688b8e2e6c9

Contents?: true

Size: 750 Bytes

Versions: 5

Compression:

Stored size: 750 Bytes

Contents

=begin
                  Arachni
  Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>

  This is free software; you can copy and distribute and modify
  this program under the term of the GPL v2.0 License
  (See LICENSE file for details)

=end

#
# Overloads the {Object} class providing a deep_clone() method
#
# @author: Tasos "Zapotek" Laskos
#                                      <tasos.laskos@gmail.com>
#                                      <zapotek@segfault.gr>
# @version: 0.1
#
class Object

    #
    # Deep-clones self using a Marshal dump-load.
    #
    def deep_clone
        begin
            return Marshal.load( Marshal.dump( self  ) )
        rescue Exception
            return self
        end
    end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arachni-0.4.0.4 lib/arachni/ruby/object.rb
arachni-0.4.0.3 lib/arachni/ruby/object.rb
arachni-0.4.0.2 lib/arachni/ruby/object.rb
arachni-0.4.0.1 lib/arachni/ruby/object.rb
arachni-0.4 lib/arachni/ruby/object.rb