Method: Functional::Tuple#intersect
- Defined in:
- lib/functional/tuple.rb
#intersect(other) ⇒ Functional::Tuple Also known as: &
Returns a new tuple containing elements common to the two tuples, excluding any duplicates. The order is preserved from the original tuple.
90 91 92 |
# File 'lib/functional/tuple.rb', line 90 def intersect(other) Tuple.new(@data & other.to_a) end |