hash string keys to symbols


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



Copy this code and paste it in your HTML
  1. my_hash = my_hash.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.