Skip to content

Commit 27987f4

Browse files
committed
Implement Enumerator::Yielder#to_proc
1 parent 8ad54d1 commit 27987f4

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Compatibility:
3333
* Implemented `rb_make_exception`.
3434
* `**kwargs` now accept non-Symbol keys like Ruby 2.7.
3535
* Updated the Unicode Emoji version (#2173, @wildmaples).
36+
* Added `Enumerator::Yielder#to_proc`.
3637

3738
Performance:
3839

src/main/ruby/truffleruby/core/enumerator.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ def <<(*args)
248248

249249
self
250250
end
251+
252+
def to_proc
253+
self.method(:yield).to_proc
254+
end
251255
end
252256

253257
class Generator

test/mri/excludes/TestEnumerator.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@
1515
exclude :test_produce, "needs investigation"
1616
exclude :test_each_slice_size, "needs investigation"
1717
exclude :test_size_for_enum_created_from_enumerable, "needs investigation"
18-
exclude :test_yielder, "needs investigation"

0 commit comments

Comments
 (0)