Ruby Tips

deep_symbolize_keys

Convert the keys of a hash into symbols

hash = { 'apple' => 'red', 'banana' => 'yellow' }

hash.deep_symbolize_keys
=> { :apple=> 'red', :banana => 'yellow' }

Ruby Tips - a simple ruby tip generator RubyTips.dev

Refresh the page to generate a new tip. Or just click here

Built by @zayneabraham

RubyTips - A random Ruby tip generator | Product Hunt Embed