Class: Hash

Inherits:
Object show all
Defined in:
lib/merb-core/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#extract!(*args) ⇒ Object

Returns the value of self for each argument and deletes those entries.

Parameters

*args

the keys whose values should be extracted and deleted.

Returns

Array

The values of the provided arguments in corresponding order.

:api: public



11
12
13
14
15
# File 'lib/merb-core/core_ext/hash.rb', line 11

def extract!(*args)
  args.map do |arg|
    self.delete(arg)
  end
end