module Corefines::Enumerable::MapSend

@!method #map_send(method_name, *args, &block)

Sends a message to each element and collects the result.

@example
  [1, 2, 3].map_send(:+, 3) #=> [4, 5, 6]

@param method_name [Symbol] name of the method to call.
@param args arguments to pass to the method.
@param block [Proc] block to pass to the method.
@return [Enumerable]

Public Instance Methods

map_send(method_name, *args, &block) click to toggle source
# File lib/corefines/enumerable.rb, line 135
def map_send(method_name, *args, &block)
  map { |e| e.__send__(method_name, *args, &block) }
end