Project

General

Profile

Actions

Feature #8490

closed

Bring ActiveSupport Enumerable#index_by to core

Added by rosenfeld (Rodrigo Rosenfeld Rosas) almost 11 years ago. Updated almost 11 years ago.

Status:
Rejected
Target version:
-
[ruby-core:55306]

Description

It seems to be a common sense to have the useful implementation of Enumerable#index_by as in ActiveSupport.

index_by acts like group_by but only maps a single record, instead of an array, keeping the last match only. It's usually used in places where you shouldn't have more than a single match for each key.

Would you consider its inclusion to core Enumerable module?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0