Sha256: 8fa3a69a160e709a1279a86654c04a18eeb7781d4abced379f6a81f21340f58d
Contents?: true
Size: 227 Bytes
Versions: 10
Compression:
Stored size: 227 Bytes
Contents
class Array # Inverse of #delete_if. # # [1,2,3].delete_unless{ |x| x < 2 } # => [1,2] # # CREDIT: Daniel Schierbeck def delete_unless(&block) delete_if { |element| not block.call(element) } end end
Version data entries
10 entries across 10 versions & 1 rubygems