Module: CSL::Extensions::StringifyKeys

Included in:
Hash
Defined in:
lib/csl/extensions.rb

Overview

ActiveSupport Fallback

Instance Method Summary collapse

Instance Method Details

#stringify_keysObject



26
27
28
29
30
31
# File 'lib/csl/extensions.rb', line 26

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

#stringify_keys!Object



33
34
35
# File 'lib/csl/extensions.rb', line 33

def stringify_keys!
  replace(symbolize_keys)
end