Method: Weak::Set#==
- Defined in:
- lib/weak/set.rb
#==(other) ⇒ Bool
Returns true if two weak sets are equal. The equality of each couple of elements is defined according to strict object equality so that, e.g., different strings are not equal, even if they may contain the same data.
335 336 337 338 339 340 341 342 343 344 |
# File 'lib/weak/set.rb', line 335 def ==(other) return true if equal?(other) return false unless Weak::Set === other other_ary = other.to_a own_ary = to_a return false unless own_ary.size == other_ary.size own_ary.all?(other) end |