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


You need to login to view comments.