Class: LitmusPaper::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/litmus_paper/util.rb

Class Method Summary collapse

Class Method Details

.symbolize_keys(hash) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/litmus_paper/util.rb', line 3

def self.symbolize_keys(hash)
  hash.keys.each do |k|
    new_key = (k.to_sym rescue k.to_s.to_sym)
    hash[new_key] = hash.delete(k)
  end

  hash
end