Ruby Select and Reject in one method

Viewed 4632

Is there any built in method that would combine the functions of Enumerable.select (find all which the block equates to true) and Enumerable.reject (find all which the block equates to false)?

Something like

good, bad = list.magic_method { |obj| obj.good? }
1 Answers
Related