Sha256: 3d7fae8d0f5d6c96f0aef7d0049622f334ff1212f178b70acbde7f0c5012c272
Contents?: true
Size: 326 Bytes
Versions: 9
Compression:
Stored size: 326 Bytes
Contents
module Enumerable def map_select(value_for_skip = nil) self.inject([]) do |acc, item| (value = yield(item)) == value_for_skip ? acc : acc << value end end def map_detect(value_for_no_matching = nil) self.each { |el| if result = yield(el) then return result end } value_for_no_matching end end
Version data entries
9 entries across 9 versions & 2 rubygems