Sha256: d8895bb0b283c9f960b92af3eb92cae4e3893d369907223747af304348fa3ba4
Contents?: true
Size: 387 Bytes
Versions: 17
Compression:
Stored size: 387 Bytes
Contents
require 'backports/1.9.1/enumerable/each_with_object' unless Enumerable.method_defined? :each_with_object unless Enumerable.method_defined? :filter_map module Enumerable def filter_map return to_enum(:filter_map) unless block_given? each_with_object([]) do |item, res| processed = yield(item) res << processed if processed end end end end
Version data entries
17 entries across 17 versions & 1 rubygems