I have a hash like:
h = {\'name\' => \'sayuj\',
\'age\' => 22,
\'project\' => {\'project_name\' => \'abc\',
\'dur
Another alternative is to use the full_dup gem (full disclosure: I am the author of that gem) that handles arrays, hashes, structs, and is extendable to user defined classes.
To use:
require 'full_dup'
# Other code omitted ...
d = h.full_dup
Also note that full_dup handles complex data relationships including those with loops or recursion.