Project

General

Profile

Actions

Bug #22189

open

`Enumerator::Lazy#to_enum` does not accept method names as strings

Bug #22189: `Enumerator::Lazy#to_enum` does not accept method names as strings

Added by nobu (Nobuyoshi Nakada) about 6 hours ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:125997]

Description

Kernel#to_enum accepts a String as well as a Symbol.

[1,2,3].to_enum(:map).to_a       #=> [1, 2, 3]
[1,2,3].to_enum("map").to_a      #=> [1, 2, 3]
[1,2,3].lazy.to_enum(:map).to_a  #=> [1, 2, 3]
[1,2,3].lazy.to_enum("map").to_a #=> []

Related to [Bug #7877].

No data to display

Actions

Also available in: PDF Atom