Actions
Feature #17153
closedAdd Enumerable#compact_map
Feature #17153:
Add Enumerable#compact_map
Status:
Closed
Assignee:
-
Target version:
-
Description
I often write code like this (map, then compact):
Or like this:
I think it would be very useful and simpler if we could do it by calling one method:
How about introducing Enumerable#compact_map ?
Updated by sawa (Tsuyoshi Sawada) about 6 years ago
Hi Ito-san,
This is a duplicate of https://bugs.ruby-lang.org/issues/5663 and https://bugs.ruby-lang.org/issues/15323, and has been realized as Enumerable#filter_map since Ruby 2.7.0.
Updated by jnchito (Junichi Ito) about 6 years ago
Oops! I didn't notice that. Thank you for letting me know. Please close this.
sawa (Tsuyoshi Sawada) wrote in #note-1:
Hi Ito-san,
This is a duplicate of https://bugs.ruby-lang.org/issues/5663 and https://bugs.ruby-lang.org/issues/15323, and has been realized as
Enumerable#filter_mapsince Ruby 2.7.0.
Updated by jeremyevans0 (Jeremy Evans) about 6 years ago
- Status changed from Open to Closed
Actions