From the docs:
uniq → new_ary
uniq { |item| ... } → new_ary
Returns a new array by removing duplicate values in self.If a block is given, it will use the return value of the block for comparison. It compares values using their
hash
andeql?
methods for efficiency.self
is traversed in order, and the first occurrence is kept.