&(enum)
public
Returns a new set containing elements
common to the set and the given enumerable object.
Set[1, 3, 5] & Set[3, 2, 1]
Set['a', 'b', 'z'] & ['a', 'b', 'c']
Show source
def &(enum)
n = self.class.new
do_with_enum(enum) { |o| n.add(o) if include?(o) }
n
end