Sha256: 1ac02f9ea68efcc12b8df7a37e1b592c8f4403c277d5e4c2c3efc5efc58d67ea
Contents?: true
Size: 212 Bytes
Versions: 4
Compression:
Stored size: 212 Bytes
Contents
class Array def subtract(other) self.select do |item| !other.has?(item) end end def has?(something) self.each do |item| return true if item == something end false end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
sub-0.3.0 | lib/sub/array.rb |
sub-0.4.0 | lib/sub/array.rb |
sub-0.4.2 | lib/sub/array.rb |
sub-0.4.1 | lib/sub/array.rb |