Class: Array
Overview
TODO: See if there is a DRYer way to make this work with Array also. Array doesn’t inherit Enumerable’s #map, so I’m forced to do this. Is there a better way to make Array inherit the modified #map?
Instance Method Summary collapse
-
#map(*args, &block) ⇒ Object
Allows mapping of a method with parameters across an array.
- #old_map ⇒ Object
Instance Method Details
#map(*args, &block) ⇒ Object
Allows mapping of a method with parameters across an array.
27 28 29 |
# File 'lib/nutella/core_ext/enumerable/map.rb', line 27 def map(*args, &block) block_given? ? old_map(&block) : old_map { |elem| elem.send *args } end |
#old_map ⇒ Object
22 |
# File 'lib/nutella/core_ext/enumerable/map.rb', line 22 alias old_map map |