The attached initializer gives your hashes a #deep_slice
method that lets you recursively
slice
Show archive.org snapshot
their contents by a given whitelist of allowed keys and sub-keys:
{ :a => { :b => 'b', :c => 'c' } }.deep_slice(:a => :c) # => { :a => { :c => 'c' } }
Posted by Henning Koch to makandra dev (2012-08-13 14:13)