RUBY: Recursive symbolize keys

/ Published in: Ruby
Save to your folder(s)


Copy this code and paste it in your HTML
  1. def recursive_symbolize_keys! hash
  2. hash.symbolize_keys!
  3.{|v| v.is_a? Hash}.each{|h| recursive_symbolize_keys!(h)}
  4. end

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.