Sha256: 3cc429d775bea402656e4de3ff709541a6df2c07ae688dcabe8d7f54d42aad01
Contents?: true
Size: 369 Bytes
Versions: 20
Compression:
Stored size: 369 Bytes
Contents
# frozen_string_literal: true Array.class_eval do # Same as `my_array.map(&block).uniq` # # @return [Array, Enumerable] # def uniq_map return to_enum(:uniq_map) unless block_given? results = [] each do |*args| result = yield(*args) next if results.include?(result) results.push(result) end return results end end
Version data entries
20 entries across 20 versions & 1 rubygems