Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest/find_minimal_combination.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#find_minimal_combination(&test) ⇒ Object

Find the minimal combination of a collection of items that satisfy test.



113
114
115
# File 'lib/minitest/find_minimal_combination.rb', line 113

def find_minimal_combination &test
  ComboFinder.new.find_minimal_combination(self, &test)
end

#find_minimal_combination_and_countObject



117
118
119
120
121
122
123
124
125
126
# File 'lib/minitest/find_minimal_combination.rb', line 117

def find_minimal_combination_and_count
  count = 0

  found = self.find_minimal_combination do |ary|
    count += 1
    yield ary
  end

  return found, count
end