lib/tabulator/reader.rb in tabulator-0.2.0 vs lib/tabulator/reader.rb in tabulator-0.3.0
- old
+ new
@@ -48,11 +48,17 @@
}
end
def apply target
self.class.new to_a.map { |row|
- row[target] = yield row[target]
+ row[target] = yield row[target], row
row
+ }
+ end
+
+ def reject
+ self.class.new to_a.reject { |row|
+ yield row
}
end
def to_a
Marshal.load(Marshal.dump(@rows))