| Module | DeepClone |
| In: |
lib/deep_clone.rb
|
1.2006.05.23 (change of the first number means Big Change)
Adds deep_clone method to an object which produces deep copy of it. It means if you clone a Hash, every nested items and their nested items will be cloned. Moreover deep_clone checks if the object is already cloned to prevent endless recursion.
(see examples directory under the ruby gems root directory) require 'rubygems' require 'deep_clone' include DeepClone obj = [] a = [ true, false, obj ] b = a.deep_clone obj.push( 'foo' ) p obj # >> [ 'foo' ] p b[2] # >> []
simplypowerful.1984.cz/goodlibs/1.2006.05.23
jan molic (/mig/at_sign/1984/dot/cz/)
You can redistribute it and/or modify it under the same terms of Ruby's license; either the dual license version in 2003, or any later version.