Skip to content

Instantly share code, notes, and snippets.

@chrisroberts
Created May 10, 2013 17:15
Show Gist options
  • Save chrisroberts/5555864 to your computer and use it in GitHub Desktop.
Save chrisroberts/5555864 to your computer and use it in GitHub Desktop.
def to_hash_recursive(hash_thing)
new = {}
hash_thing.each do |k,v|
new[k] = v.kind_of?(Hash) ? to_hash(v) : v
end
new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment