lib/core/hash.rb
# Converts all of the keys to strings
# can pass in a :key_modifier that will be sent to each key, before being symbolized.
# This can be usefull if you want to downcase, or snake_case each key.
# >> {'Placement' => {'AvailabilityZone'=>"us-east-1a"} }.symbolize_keys(:snake_case)
# => {:placement=>{:availability_zone=>"us-east-1a"}}  
Converts all of the keys to strings
can pass in a :key_modifier that will be sent to each key, before being symbolized.
This can be usefull if you want to downcase, or snake_case each key.
Converts all of the keys to strings can pass in a : key_modifier that will be sent to each key before being symbolized . This can be usefull if you want to downcase or snake_case each key .
def symbolize_keys!(key_modifier=nil) 
    keys.each{|k| 
      v = delete(k)
      if key_modifier && k.respond_to?(key_modifier)
        k = k.send(key_modifier)
      end
      self[k.to_sym] = v
      v.symbolize_keys!(key_modifier) if v.is_a?(Hash)
      v.each{|p| p.symbolize_keys!(key_modifier) if p.is_a?(Hash)} if v.is_a?(Array)
    }
    self
  end
def symbolize_keys! ( key_modifier = nil ) keys . each { | k | v = delete ( k ) if key_modifier && k . respond_to? ( key_modifier ) k = k . send ( key_modifier ) end self [ k . to_sym ] = v v . symbolize_keys! ( key_modifier ) if v . is_a? ( Hash ) v . each { | p | p . symbolize_keys! ( key_modifier ) if p . is_a? ( Hash ) } if v . is_a? ( Array ) } self end
Converts all of the keys to strings
can pass in a :key_modifier that will be sent to each key, before being symbolized.
Converts all of the keys to strings can pass in a : key_modifier that will be sent to each key before being symbolized .
key_modifier