Method: Hash#symbolize_keys
- Defined in:
- lib/github_api2/core_ext/hash.rb
#symbolize_keys ⇒ Object
Returns a new hash with all the keys converted to symbols
20 21 22 23 24 25 |
# File 'lib/github_api2/core_ext/hash.rb', line 20 def symbolize_keys inject({}) do |hash, (key, value)| hash[(key.to_sym rescue key) || key] = value hash end end |