Sha256: 56c0ad99add5a6ab89c8dec2903f8d1dde1b7d47e8f4332c34673175072e5a3f

Contents?: true

Size: 204 Bytes

Versions: 10

Compression:

Stored size: 204 Bytes

Contents

class Hash

  # In-place version of Hash#select.  The opposite of the built-in
  # Hash#reject!.
  #
  # CREDIT: Gavin Sinclair, Noah Gibbs

  def select!
    reject! { |k,v| not yield(k,v) }
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/hash/select.rb
facets-2.8.3 lib/core/facets/hash/select.rb
facets-2.8.2 lib/core/facets/hash/select.rb
facets-2.8.1 lib/core/facets/hash/select.rb
facets-2.8.0 lib/core/facets/hash/select.rb
facets-2.7.0 lib/core/facets/hash/select.rb
facets-2.6.0 lib/core/facets/hash/select.rb
facets-2.5.1 lib/core/facets/hash/select.rb
facets-2.5.0 lib/core/facets/hash/select.rb
facets-2.5.2 lib/core/facets/hash/select.rb