Skip to content

Instantly share code, notes, and snippets.

View andrewpcone's full-sized avatar

Andrew Cone andrewpcone

View GitHub Profile
@andrewpcone
andrewpcone / recurive_symbolize.rb
Created April 28, 2014 01:36
Recursively symbolize_keys in a nested ruby hash
require 'active_support/core_ext/hash'
def symbolize_keys!(thing)
case thing
when Array
thing.each{|v| symbolize_keys!(v)}
when Hash
thing.symbolize_keys!
thing.values.each{|v| symbolize_keys!(v)}
end