Method: Weak::Set#add?
- Defined in:
- lib/weak/set.rb
#add?(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.
Adds the given object to the weak set and returns self. If the object is
already in the set, returns nil.
389 390 391 |
# File 'lib/weak/set.rb', line 389 def add?(obj) add(obj) unless include?(obj) end |