method

excluding

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Enumerable
excluding(*elements) public

Returns a copy of the enumerable excluding the specified elements.

["David", "Rafael", "Aaron", "Todd"].excluding "Aaron", "Todd"
# => ["David", "Rafael"]

["David", "Rafael", "Aaron", "Todd"].excluding %w[ Aaron Todd ]
# => ["David", "Rafael"]

{foo: 1, bar: 2, baz: 3}.excluding :bar
# => {foo: 1, baz: 3}
Show source
Register or log in to add new notes.