method
slice!
v2.3.8 -
Show latest stable
- Class:
ActiveSupport::CoreExtensions::Hash::Slice
slice!(*keys)public
Replaces the hash with only the given keys. Returns a hash contained the removed key/value pairs
{:a => 1, :b => 2, :c => 3, :d => 4}.slice!(:a, :b) # => {:c => 3, :d =>4}