instance method
except
Ruby on Rails edge
Since v6.0.6.1Signature
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 376
def except(*keys)
dup.except!(*keys)
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 376
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess