deep_merge!

deep_merge!(other_hash, &block) Instance Public methods Same as deep_merge, but modifies self.

deep_stringify_keys

deep_stringify_keys() Instance Public methods Returns a new hash with all keys converted to strings. This includes the keys from the root hash and from all nested hashes and arrays. hash = { person: { name: 'Rob', age: '28' } } hash.deep_stringify_keys # => {"person"=>{"name"=>"Rob", "age"=>"28"}}

deep_stringify_keys!

deep_stringify_keys!() Instance Public methods Destructively convert all keys to strings. This includes the keys from the root hash and from all nested hashes and arrays.

deep_symbolize_keys

deep_symbolize_keys() Instance Public methods Returns a new hash with all keys converted to symbols, as long as they respond to to_sym. This includes the keys from the root hash and from all nested hashes and arrays. hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } } hash.deep_symbolize_keys # => {:person=>{:name=>"Rob", :age=>"28"}}

deep_symbolize_keys!

deep_symbolize_keys!() Instance Public methods Destructively convert all keys to symbols, as long as they respond to to_sym. This includes the keys from the root hash and from all nested hashes and arrays.

deep_transform_keys

deep_transform_keys(&block) Instance Public methods Returns a new hash with all keys converted by the block operation. This includes the keys from the root hash and from all nested hashes and arrays. hash = { person: { name: 'Rob', age: '28' } } hash.deep_transform_keys{ |key| key.to_s.upcase } # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}}

deep_transform_keys!

deep_transform_keys!(&block) Instance Public methods Destructively convert all keys by using the block operation. This includes the keys from the root hash and from all nested hashes and arrays.

except

except(*keys) Instance Public methods Returns a hash that includes everything but the given keys. This is useful for limiting a set of parameters to everything but a few known toggles: @person.update(params[:person].except(:admin))

except!

except!(*keys) Instance Public methods Replaces the hash without the given keys.

extract!

extract!(*keys) Instance Public methods Removes and returns the key/value pairs matching the given keys. { a: 1, b: 2, c: 3, d: 4 }.extract!(:a, :b) # => {:a=>1, :b=>2} { a: 1, b: 2 }.extract!(:a, :x) # => {:a=>1}