Project

General

Profile

Actions

Bug #22189

closed

`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) 21 days ago. Updated 17 days ago.

Status:
Closed
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].

Actions

Also available in: PDF Atom