lib/sugar-high/array.rb in sugar-high-0.4.5 vs lib/sugar-high/array.rb in sugar-high-0.4.5.2
- old
+ new
@@ -1,9 +1,15 @@
require 'sugar-high/kind_of'
require 'sugar-high/enumerable'
require 'sugar-high/path'
-class Array
+class Array
+ def without(*values)
+ copy = self.dup
+ values.flatten.each { |value| copy.delete(value) }
+ copy
+ end
+
def to_symbols
res = self.flatten.select_labels
res = res.map{|a| a.to_s.to_sym } if res
res || []
end