Module: Equipoise::Util

Defined in:
lib/equipoise/util.rb

Class Method Summary collapse

Class Method Details

.symbolize_keys(hash) ⇒ Object

Shallow string→symbol key transform; passes non-Hash input through untouched.



19
20
21
22
23
# File 'lib/equipoise/util.rb', line 19

def symbolize_keys(hash)
  return hash unless hash.is_a?(Hash)

  hash.each_with_object({}) { |(key, value), out| out[key.to_sym] = value }
end