Sha256: 748c11ba0b28de74e638de7b19f7cd69ed6c8375ba48ba9da29bb2db73edd1e0
Contents?: true
Size: 267 Bytes
Versions: 10
Compression:
Stored size: 267 Bytes
Contents
class Array # As with #select but modifies the Array in place. # # a = [1,2,3,4,5,6,7,8,9,10] # a.select!{ |e| e % 2 == 0 } # a #=> [2,4,6,8,10] # # CREDIT: Gavin Sinclair # def select! # :yield: reject!{ |e| not yield(e) } end end
Version data entries
10 entries across 10 versions & 1 rubygems