def uniq(input, property = nil)
      ary = InputIterator.new(input)

      if property.nil?
        ary.uniq
      elsif ary.empty? # The next two cases assume a non-empty array.
        []
      elsif ary.first.respond_to?(:[])
        begin
          ary.uniq { |a| a[property] }
        rescue TypeError
          raise_property_error(property)
        end
      end
    end
def uniq(input, property = nil)
      ary = InputIterator.new(input)

      if property.nil?
        ary.uniq
      elsif ary.empty? # The next two cases assume a non-empty array.
        []
      elsif ary.first.respond_to?(:[])
        begin
          ary.uniq { |a| a[property] }
        rescue TypeError
          raise_property_error(property)
        end
      end
    end
Remove duplicate elements from an array
 provide optional property with which to determine uniqueness