Class: Set

Class | Set
In: | lib/more/facets/set.rb
Parent: | Object

### Methods

power_set

### Public Instance methods

power_set()

[Source]

    # File lib/more/facets/set.rb, line 4
      def power_set
        if empty?
          Set[ self ]
        else
          any_value = [to_a.first]
          subsubs = (self - any_value).power_set
          subsubs + subsubs.map{ |subset| subset + any_value }
        end
      end

[Validate]