| Class | Set |
| In: |
lib/aquarium/extensions/set.rb
|
| Parent: | Object |
# File lib/aquarium/extensions/set.rb, line 7
7: def == set
8: equal?(set) and return true
9: set.is_a?(Set) && size == set.size or return false
10: ary = to_a
11: set.all? { |o| ary.include?(o) }
12: end
It seems that Set#& should work, but for some reason, it doesn‘t.
# File lib/aquarium/extensions/set.rb, line 24
24: def intersection_using_eql_comparison other
25: first = dup
26: second = other.dup
27: first.size > second.size ? do_intersection(first, second) : do_intersection(second, first)
28: end