Class: Hash

Inherits:
Object show all
Defined in:
lib/ext/hash.rb

Overview

Extends Hash with additional helper methods

Instance Method Summary collapse

Instance Method Details

#symbolize_keysHash

Allows for conversion of string keys to symbols

Returns:

  • (Hash)

    hash with symbols for keys



5
6
7
# File 'lib/ext/hash.rb', line 5

def symbolize_keys
  each_with_object({}) { |(k, v), memo| memo[k.to_sym] = v }
end