Project

General

Profile

Actions

Feature #13562

closed

Use a sized enumerator with #yield_self

Added by shan (Shannon Skipper) almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:81151]

Description

The #yield_self Enumerator instance always has a #count of 1. I think it might be nice to provide a lazy #size of 1 to match the #count for parity.

Currently:

42.yield_self.count #=> 1
42.yield_self.size #=> nil

I propose:

42.yield_self.count #=> 1
42.yield_self.size #=> 1
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0