Sha256: 297de97ffb2342c7d371f2fc6adbe1d8344b20fd03373bd36cbe0cc9604cb540
Contents?: true
Size: 456 Bytes
Versions: 10
Compression:
Stored size: 456 Bytes
Contents
module Enumerable # Send a message to each element and collect the result. # # CREDIT: Sean O'Halpin def map_send(meth, *args, &block) map{|e| e.send(meth, *args, &block)} end # Send a message to each element and collect the result. # # CREDIT: Sean O'Halpin # #def map_send(meth, *args) #:yield: # if block_given? # map{|e| yield(e.send(meth, *args))} # else # map{|e| e.send(meth, *args)} # end #end end
Version data entries
10 entries across 10 versions & 1 rubygems