:invalid_records def call split_records = records.group_by {|r| valid?(r)} result split_records[true], split_records[false] end private def valid?(record); …; end end ValidateRecords.([invalid, invalid2, valid]) # => <struct valid_records=[valid], invalid_records=[invalid,invalid2]>