Skip to content

Instantly share code, notes, and snippets.

@sodabrew
Created October 7, 2009 17:48
Show Gist options
  • Save sodabrew/204252 to your computer and use it in GitHub Desktop.
Save sodabrew/204252 to your computer and use it in GitHub Desktop.
# Is there a better way to deep copy a structure in Ruby?
if templates.has_key?(ip)
# There's no deep copy in Ruby, so we do this horrific thing
desired_records = Marshal::load(Marshal.dump(templates[ip]))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment