instance method
except!
Ruby on Rails 7.0.10
Since v3.0.20Signature
except!(*keys)
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 }
Parameters
-
keysrest
Source
# File activesupport/lib/active_support/core_ext/hash/except.rb, line 20
def except!(*keys)
keys.each { |key| delete(key) }
self
end
Defined in activesupport/lib/active_support/core_ext/hash/except.rb line 20
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Hash