Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/couch_view/array.rb

Instance Method Summary collapse

Instance Method Details

#all_combinationsObject



2
3
4
5
6
7
8
# File 'lib/couch_view/array.rb', line 2

def all_combinations
  (0..self.length).map do |i| 
    (combination i).to_a 
  end.inject([]) do |sum, value| 
    sum += value 
  end
end