Flowdock
method

extract!

Importance_1
v3.2.1 - Show latest stable - 1 note - Class: Hash
extract!(*keys) public

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}
Show source
Register or log in to add new notes.
September 8, 2013
0 thanks

without a bang

We can use hash#slice if we want an Hash#extract (without bang) like behavior.