Sha256: 840fb06539fe92b6c0d5ea9f6bb6788976bad5509f3f8a4ca88ee08f96e550a3

Contents?: true

Size: 384 Bytes

Versions: 4

Compression:

Stored size: 384 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

4 entries across 4 versions & 1 rubygems

Version Path
BrianTheCoder-ratpack-0.2.2 lib/ratpack/core_ext/hash.rb
BrianTheCoder-ratpack-0.2.3 lib/ratpack/core_ext/hash.rb
BrianTheCoder-ratpack-0.2.4 lib/ratpack/core_ext/hash.rb
BrianTheCoder-ratpack-0.3.1 lib/ratpack/core_ext/hash.rb