Sha256: c0185690f97e1d456e5c1efbbaceda6d4add3b4c184d08ab3734d580c816162e
Contents?: true
Size: 480 Bytes
Versions: 7
Compression:
Stored size: 480 Bytes
Contents
require 'tins/string_version' module Tins module UniqBy if Tins::StringVersion.compare(RUBY_VERSION, :<=, "1.8") def uniq_by(&block) block ||= lambda { |x| x } inject({}) { |h, e| h[ block.call(e) ] ||= e; h }.values end else require 'tins/deprecate' extend Tins::Deprecate deprecate method: def uniq_by(&block) uniq(&block) end, new_method: :uniq end end end require 'tins/alias'
Version data entries
7 entries across 7 versions & 1 rubygems