Sha256: a766749c7431ede27cc1fddc571ffce9e3287b2f29c98863566a918e0108ece6

Contents?: true

Size: 541 Bytes

Versions: 1

Compression:

Stored size: 541 Bytes

Contents

class Array
  # *DEPRECATED*: Use +Array#uniq+ instead.
  #
  # Returns a unique array based on the criteria in the block.
  #
  #   [1, 2, 3, 4].uniq_by { |i| i.odd? } # => [1, 2]
  def uniq_by(&block)
    ActiveSupport::Deprecation.warn 'uniq_by is deprecated. Use Array#uniq instead'
    uniq(&block)
  end

  # *DEPRECATED*: Use +Array#uniq!+ instead.
  #
  # Same as +uniq_by+, but modifies +self+.
  def uniq_by!(&block)
    ActiveSupport::Deprecation.warn 'uniq_by! is deprecated. Use Array#uniq! instead'
    uniq!(&block)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activesupport-4.0.0.beta1 lib/active_support/core_ext/array/uniq_by.rb