提交 173eacad 编写于 作者: X Xavier Noria

adds deprecation warnings to the RDoc of Array#uniq_by(!)

上级 737960d9
class Array
# Returns an unique array based on the criteria given as a +Proc+.
# *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]
#
......@@ -9,7 +11,9 @@ def uniq_by(&block)
uniq(&block)
end
# Same as uniq_by, but modifies self.
# *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", caller
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册