Comment puis-je transmettre un nombre variable d'arguments à un rendement. Je ne veux pas passer un tableau (comme le fait le code suivant), je voudrais vraiment les passer comme un nombre programmatique d'args au bloc.Comment est-ce que je peux passer par programme des arguments pour céder dans Ruby?
def each_with_attributes(attributes, &block)
results[:matches].each_with_index do |match, index|
yield self[index], attributes.collect { |attribute| (match[:attributes][attribute] || match[:attributes]["@#{attribute}"]) }
end
end