Class: Object

Inherits:
BasicObject
Defined in:
lib/notifu/mixins.rb

Instance Method Summary collapse

Instance Method Details

#deep_symbolize_keysObject


2
3
4
5
6
# File 'lib/notifu/mixins.rb', line 2

def deep_symbolize_keys
  return self.inject({}){|memo,(k,v) | memo[k.to_sym] =  v.deep_symbolize_keys; memo} if self.is_a? Hash
  return self.inject([]){|memo,v     | memo           << v.deep_symbolize_keys; memo} if self.is_a? Array
  return self
end