lib/numerictth2.rb in numerictth2-0.1.0 vs lib/numerictth2.rb in numerictth2-0.1.1
- old
+ new
@@ -9,5 +9,13 @@
end
class String
include Numerictth2
end
+
+class Array
+ def split_by_partiy
+ partition(&:even?)
+ end
+end
+
+#even, odd = [1,2,3,4].split_by_partiy // even // odd
\ No newline at end of file