Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#symbolize_keysHash

Return duplication of self with all keys non-recursively converted to symbols

Returns:

  • (Hash)

    A hash with all keys transformed into symbols

Author:

  • Botanicus

Since:

  • 0.0.2



40
41
42
43
44
45
# File 'lib/rango/core_ext.rb', line 40

def symbolize_keys
  self.inject(Hash.new) do |result, array|
    result[array.first.to_sym] = array.last
    result
  end
end