Merge pull request #6264 from dearblue/to_enum

Must pass keyword arguments for `Kernel#to_enum`
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-05-14 01:28:14 +09:00
committed by GitHub
@@ -659,8 +659,8 @@ module Kernel
# # => returns an Enumerator when called without a block
# enum.first(4) # => [1, 1, 1, 2]
#
def to_enum(meth=:each, *args)
Enumerator.new self, meth, *args
def to_enum(meth=:each, *args, **kwd)
Enumerator.new self, meth, *args, **kwd
end
alias enum_for to_enum
end