1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Don't expose Enumerable#_original_sum_with_required_identity which is internal API [ci skip]

`:nodoc:` is specified, but unfortunately, it is exposed in the API doc.
http://edgeapi.rubyonrails.org/classes/Enumerable.html#method-i-_original_sum_with_required_identity

If the method of the `alias` destination is public, the specification of
`:nodoc:` does not seem to work.
This commit is contained in:
yuuji.yaginuma 2018-06-04 09:53:59 +09:00
parent d3e0a9f110
commit 69d91cd6a6

View file

@ -7,11 +7,15 @@ module Enumerable
# Enumerable#sum was added in Ruby 2.4, but it only works with Numeric elements
# when we omit an identity.
# :stopdoc:
# We can't use Refinements here because Refinements with Module which will be prepended
# doesn't work well https://bugs.ruby-lang.org/issues/13446
alias :_original_sum_with_required_identity :sum # :nodoc:
alias :_original_sum_with_required_identity :sum
private :_original_sum_with_required_identity
# :startdoc:
# Calculates a sum from the elements.
#
# payments.sum { |p| p.price * p.tax_rate }