Sha256: b356d6d71f57df82adfafe490d9d91a6ca0e6405c0a0cc82b0e3aba5d0fbbab4

Contents?: true

Size: 385 Bytes

Versions: 25

Compression:

Stored size: 385 Bytes

Contents

class Hash
  # 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[Object]:: The values of the provided arguments in corresponding order.
  #
  # :api: public
  def extract!(*args)
    args.map do |arg|
      self.delete(arg)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
merb-core-1.1.3 lib/merb-core/core_ext/hash.rb
merb-core-1.1.2 lib/merb-core/core_ext/hash.rb
merb-core-1.1.1 lib/merb-core/core_ext/hash.rb
merb-core-1.1.0 lib/merb-core/core_ext/hash.rb
merb-core-1.1.0.rc1 lib/merb-core/core_ext/hash.rb
merb-core-1.1.0.pre lib/merb-core/core_ext/hash.rb
merb-core-1.0.15 lib/merb-core/core_ext/hash.rb
merb-core-1.0.14 lib/merb-core/core_ext/hash.rb
merb-core-1.0.13 lib/merb-core/core_ext/hash.rb
merb-core-1.0.12 lib/merb-core/core_ext/hash.rb
merb-core-1.0.2 lib/merb-core/core_ext/hash.rb
merb-core-1.0.10 lib/merb-core/core_ext/hash.rb
merb-core-1.0.1 lib/merb-core/core_ext/hash.rb
merb-core-1.0.11 lib/merb-core/core_ext/hash.rb
merb-core-1.0.3 lib/merb-core/core_ext/hash.rb
merb-core-1.0.4 lib/merb-core/core_ext/hash.rb
merb-core-1.0.5 lib/merb-core/core_ext/hash.rb
merb-core-1.0.6.1 lib/merb-core/core_ext/hash.rb
merb-core-1.0.7.1 lib/merb-core/core_ext/hash.rb
merb-core-1.0.8.1 lib/merb-core/core_ext/hash.rb