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

Version Path
facets-2.8.4 lib/core/facets/enumerable/map_send.rb
facets-2.8.3 lib/core/facets/enumerable/map_send.rb
facets-2.8.2 lib/core/facets/enumerable/map_send.rb
facets-2.8.1 lib/core/facets/enumerable/map_send.rb
facets-2.8.0 lib/core/facets/enumerable/map_send.rb
facets-2.7.0 lib/core/facets/enumerable/map_send.rb
facets-2.6.0 lib/core/facets/enumerable/map_send.rb
facets-2.5.0 lib/core/facets/enumerable/map_send.rb
facets-2.5.1 lib/core/facets/enumerable/map_send.rb
facets-2.5.2 lib/core/facets/enumerable/map_send.rb