Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/backnob/hash.rb

Overview

:nodoc: all

Direct Known Subclasses

AttrHash

Instance Method Summary collapse

Instance Method Details

#symbolize_keys!Object

Destructively convert all keys to symbols.



3
4
5
6
7
8
9
10
11
# File 'lib/backnob/hash.rb', line 3

def symbolize_keys!
  keys.each do |key|
    unless key.is_a?(Symbol)
      self[key.to_sym] = self[key]
      delete(key)
    end
  end
  self
end