Class: TreeClusters::AttrArray

Inherits:
Object::Array
  • Object
show all
Defined in:
lib/tree_clusters/attr_array.rb

Overview

Provides convenience methods for working with Arrays of Sets

Instance Method Summary collapse

Instance Method Details

#intersectionSet

Takes the intersection of all sets in the AttrArray

Returns:

  • (Set)


14
15
16
# File 'lib/tree_clusters/attr_array.rb', line 14

def intersection
  self.reduce(&:intersection)
end

#unionSet

Takes the union of all sets in the AttrArray

Returns:

  • (Set)


7
8
9
# File 'lib/tree_clusters/attr_array.rb', line 7

def union
  self.reduce(&:union)
end