Skip to content

Instantly share code, notes, and snippets.

@sodabrew
Created October 7, 2009 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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