Module: Mysql2::Util

Defined in:
lib/mysql2.rb

Overview

For holding utility methods

Class Method Summary collapse

Class Method Details

.key_hash_as_symbols(hash) ⇒ Object

Rekey a string-keyed hash with equivalent symbols.



36
37
38
39
# File 'lib/mysql2.rb', line 36

def self.key_hash_as_symbols(hash)
  return nil unless hash
  Hash[hash.map { |k,v| [k.to_sym, v] }]
end