Method: Functional::Tuple#union

Defined in:
lib/functional/tuple.rb

#union(other) ⇒ Functional::Tuple Also known as: |

Returns a new tuple by joining self with other, excluding any duplicates and preserving the order from the original tuple.

Parameters:

  • other (Array)

    the tuple or array-like object (responds to ‘to_a`) to operate on

Returns:



99
100
101
# File 'lib/functional/tuple.rb', line 99

def union(other)
  Tuple.new(@data | other.to_a)
end