lib/core_ext/hash.rb
def rubyify_keys!
    keys.each{|k|
      v = delete(k)
      new_key = k.to_s.underscore
      self[new_key] = v
      v.rubyify_keys! if v.is_a?(Hash)
      v.each{|p| p.rubyify_keys! if p.is_a?(Hash)} if v.is_a?(Array)
    }
    self
  end
# Converts all of the keys to strings, optionally formatting key name
Converts all of the keys to strings, optionally formatting key name
Converts all of the keys to strings optionally formatting key name
def rubyify_keys!
    keys.each{|k|
      v = delete(k)
      new_key = k.to_s.underscore
      self[new_key] = v
      v.rubyify_keys! if v.is_a?(Hash)
      v.each{|p| p.rubyify_keys! if p.is_a?(Hash)} if v.is_a?(Array)
    }
    self
  end
def rubyify_keys! keys . each { | k | v = delete ( k ) new_key = k . to_s . underscore self [ new_key ] = v v . rubyify_keys! if v . is_a? ( Hash ) v . each { | p | p . rubyify_keys! if p . is_a? ( Hash ) } if v . is_a? ( Array ) } self end
Converts all of the keys to strings, optionally formatting key name
Converts all of the keys to strings optionally formatting key name