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