Some times we need uniq objects while performing complex operationsand avoid duplicate..def make_uniq_by(&blk)object_set = []self.select do |el|only_uniq_objects = !object_set.include?(data=blk[el])object_set << dataonly_uniq_objectsendend
Thanks …. Feedback and suggestion are welcome..
Advertisement