Module: CiteProc::Extensions::SymbolizeKeys

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

Overview

shamelessly copied from active_support

Instance Method Summary collapse

Instance Method Details

#symbolize_keysObject



38
39
40
41
42
43
# File 'lib/citeproc/extensions.rb', line 38

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

#symbolize_keys!Object



45
46
47
# File 'lib/citeproc/extensions.rb', line 45

def symbolize_keys!
  replace(symbolize_keys)
end