Sha256: 2059455f4dddb25783ce967a7f97c584823b92bb66525adeec5ad85342eeb98a

Contents?: true

Size: 314 Bytes

Versions: 15

Compression:

Stored size: 314 Bytes

Contents

# frozen_string_literal: true

class Hash
  # Removes the given keys from hash and returns it.
  #   hash = { a: true, b: false, c: nil }
  #   hash.except!(:c) # => { a: true, b: false }
  #   hash             # => { a: true, b: false }
  def except!(*keys)
    keys.each { |key| delete(key) }
    self
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
activesupport-8.0.2 lib/active_support/core_ext/hash/except.rb
tailscale_middleware-0.0.3 vendor/cache/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/core_ext/hash/except.rb
activesupport-8.0.1 lib/active_support/core_ext/hash/except.rb
activesupport-8.0.0.1 lib/active_support/core_ext/hash/except.rb
activesupport-8.0.0 lib/active_support/core_ext/hash/except.rb
activesupport-8.0.0.rc2 lib/active_support/core_ext/hash/except.rb
activesupport-8.0.0.rc1 lib/active_support/core_ext/hash/except.rb
activesupport-8.0.0.beta1 lib/active_support/core_ext/hash/except.rb
omg-activesupport-8.0.0.alpha9 lib/active_support/core_ext/hash/except.rb
omg-activesupport-8.0.0.alpha8 lib/active_support/core_ext/hash/except.rb
omg-activesupport-8.0.0.alpha7 lib/active_support/core_ext/hash/except.rb
omg-activesupport-8.0.0.alpha4 lib/active_support/core_ext/hash/except.rb
omg-activesupport-8.0.0.alpha3 lib/active_support/core_ext/hash/except.rb
omg-activesupport-8.0.0.alpha2 lib/active_support/core_ext/hash/except.rb
omg-activesupport-8.0.0.alpha1 lib/active_support/core_ext/hash/except.rb