method

extract!

v3.0.9 - Show latest stable - Class: Hash
extract!(*keys)
public

No documentation available.

# File activesupport/lib/active_support/core_ext/hash/slice.rb, line 33
  def extract!(*keys)
    result = {}
    keys.each {|key| result[key] = delete(key) }
    result
  end

1Note

without a bang

freemanoid321 ยท Sep 8, 2013

We can use hash#slice[http://api.rubyonrails.org/classes/Hash.html#method-i-slice] if we want an Hash#extract (without bang) like behavior.