Sha256: 092c20ea83d592a6cedaafb9d2816c953095f2ca75e0ce42ae0f721d9606820e

Contents?: true

Size: 750 Bytes

Versions: 5

Compression:

Stored size: 750 Bytes

Contents

=begin
                  Arachni
  Copyright (c) 2010-2011 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.3 lib/ruby/object.rb
arachni-0.2.4 lib/ruby/object.rb
arachni-0.2.3 lib/ruby/object.rb
arachni-0.2.2.2 lib/ruby/object.rb
arachni-0.2.2.1 lib/ruby/object.rb