Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/invisible/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#symbolize_keysObject

Return a new hash with all keys converted to symbols.



5
6
7
8
9
10
# File 'lib/invisible/core_ext.rb', line 5

def symbolize_keys
  inject({}) do |options, (key, value)|
    options[(key.to_sym rescue key) || key] = value
    options
  end
end