Project

General

Profile

Actions

Feature #16667

open

Allow parameters to Symbol#to_proc and Method#to_proc

Added by jgomo3 (Jesús Gómez) over 1 year ago. Updated over 1 year ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:97319]

Description

Allow parameters to Symbol#to_proc and Method#to_proc

So we can say:

ary.map(:dig.to_proc(:id))

Instead of

ary.map { |e| e.dig(:id) }

Oppening the posibilities to refine the & operator in the future, for something like:

ary.map(&(:dig, :id))

Related:

Actions

Also available in: Atom PDF