Sha256: edcac434a16ac2112790dea3883e6bb584bd3d44249d0057cc9d3049371fcc58
Contents?: true
Size: 265 Bytes
Versions: 3
Compression:
Stored size: 265 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
facets-2.2.1 | lib/core/facets/array/select.rb |
facets-2.2.0 | lib/core/facets/array/select.rb |
facets-2.3.0 | lib/core/facets/array/select.rb |