Feature Request #6

Allow Enumerable#map to accept arguments

Added by Daniel Berger 882 days ago.

Status:New Start:02/28/2008
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:Core Class Spent time: -
Target version:-

Description

With Enumerable#map you typically want to perform a single operation. Allow Enumerable#map to accept a method name and arguments that will be applied to all elements of a list.
# Example 1 - Method, no arguments
['foo', 'bar', 'baz'].map(:upcase) => ['FOO', 'BAR', 'BAZ']

# Example 2 - Method, with arguments
[1, 2, 3].map(:+, 5) => [6, 7, 8]

Also available in: Atom PDF