Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/laze/core_extensions.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#stringify_keysObject



2
3
4
5
6
7
# File 'lib/laze/core_extensions.rb', line 2

def stringify_keys
  inject({}) do |output, (key, value)|
    output[(key.to_s rescue key) || key] = value
    output
  end
end

#symbolize_keysObject



9
10
11
12
13
14
# File 'lib/laze/core_extensions.rb', line 9

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