Sha256: 81a06ae7fa4607466a00cc9685a2463a1dbe9edab22894a6fde9f11c047f283e

Contents?: true

Size: 177 Bytes

Versions: 4

Compression:

Stored size: 177 Bytes

Contents

module ::Enumerable
  def map_compact
    result = []
    each do |item|
      selected = yield(item)
      result << selected unless selected.nil?
    end
    result
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
invoca-utils-0.1.0.pre.2 lib/invoca/utils/map_compact.rb
invoca-utils-0.0.5 lib/invoca/utils/map_compact.rb
invoca-utils-0.0.4 lib/invoca/utils/map_compact.rb
invoca-utils-0.0.3 lib/invoca/utils/map_compact.rb