Method: Weak::Set#delete

Defined in:
lib/weak/set.rb

#delete(obj) ⇒ self

Note:

Weak::Set does not test member equality with ‘==` or `eql?`. Instead, it always checks strict object equality, so that, e.g., different strings are not considered equal, even if they may contain the same string content.

Deletes the given object from ‘self` and returns `self`. Use #subtract to delete many items at once.

Parameters:

  • obj (Object)

    an object to delete from the weak set

Returns:

  • (self)

    always returns self


427
428
429
430
# File 'lib/weak/set.rb', line 427

def delete(obj)
  delete?(obj)
  self
end