def build_targets(targets)
      targets.to_a.map do |object, row|
        preferences, capacity = parse_target_row(row)
        target(object).tap do |t|
          t.capacity = capacity
          t.prefer(*preferences.map { |c| candidate(c) })
        end
      end
    end
def build_targets(targets)
      targets.to_a.map do |object, row|
        preferences, capacity = parse_target_row(row)
        target(object).tap do |t|
          t.capacity = capacity
          t.prefer(*preferences.map { |c| candidate(c) })
        end
      end
    end
Initializes the Matchbook with an empty cache.
 Builds a list of targets for the +MatchMaker+.
 The parameter is a hash of unwrapped target objects to their preferred
 candidates and maximum capacity (a 2-tuple expressed as an array):

 @example With explicit capacities
   matchbook.build_targets(
     'Gryffindor' => [['Hermione', 'Ron', 'Harry'], 2],
     'Ravenclaw'  => [['Hermione'], 1],
     'Hufflepuff' => [['Neville', 'Hermione'], 2],
     'Slytherin'  => [['Harry', 'Hermione', 'Ron', 'Neville'], 4]
   )

 The capacity may also be omitted, in which case it defaults to 1:

 @example With explicit capacities
   matchbook.build_targets(
     'Gryffindor' => ['Hermione', 'Ron', 'Harry'],
     'Ravenclaw'  => ['Hermione'],
     'Hufflepuff' => ['Neville', 'Hermione'],
     'Slytherin'  => ['Harry', 'Hermione', 'Ron', 'Neville'],
   )

 @param targets [Hash<Object, Array<Object>>]
   Hash of target objects to a list of their preferred candidates