lib/sugar-high/array.rb in sugar-high-0.4.4.1 vs lib/sugar-high/array.rb in sugar-high-0.4.4.2
- old
+ new
@@ -89,18 +89,20 @@
end
def extract(sym)
map { |e| e.send(sym) }
end
+end
+module MathArray
def sum
inject( 0 ) { |sum,x| sum + x }
end
def mean
(size > 0) ? sum.to_f / size : 0
end
-end
+end
module FilesArray
def delete_all!
self.each do |f|
f.delete! if f.kind_of?(File)