lib/eco/csv.rb in eco-helpers-3.0.3 vs lib/eco/csv.rb in eco-helpers-3.0.4
- old
+ new
@@ -27,17 +27,19 @@
# @yieldreturn [Bollean] whether the row should be included
# @param filename [String] the orignal file
# @param max_rows [Integer] number of rows per file
# @param start_at [Integer] row that sets the starting point.
# Leave empty for the full set of rows.
- # @see Eco::CSV::Split#call
+ # @return [Eco::CSV::Split]
def split(filename, max_rows:, start_at: nil, **kargs, &block)
Eco::CSV::Split.new(
filename,
max_rows: max_rows,
start_at: start_at,
**kargs
- ).call(&block)
+ ).tap do |splitter|
+ splitter.call(&block)
+ end
end
# @note it excludes headers by default
# @return [Integer] the number of rows of the file
def count(filename, start_at: nil, **kargs)