instance method
except
Ruby on Rails 8.0.4
Since v6.0.6Signature
except(*keys)
Returns a hash with indifferent access that includes everything except given keys.
hash = { a: "x", b: "y", c: 10 }.with_indifferent_access hash.except(:a, "b") # => {c: 10}.with_indifferent_access hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access
Parameters
-
keysrest
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 309
def except(*keys)
dup.except!(*keys)
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 309
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess