Method: Hash#symbolize_keys
- Defined in:
- lib/webgen/core_ext.rb
#symbolize_keys ⇒ Object
Return a new hash where all String keys are converted to Symbol keys.
19 20 21 22 23 |
# File 'lib/webgen/core_ext.rb', line 19 def symbolize_keys hash = dup hash.keys.each {|k| hash[(k.to_sym rescue k)] = hash.delete(k)} hash end |