lib/io_streams/row/reader.rb in iostreams-1.0.0.beta vs lib/io_streams/row/reader.rb in iostreams-1.0.0.beta2

- old
+ new

@@ -3,12 +3,12 @@ # Converts each line of an input stream into an array for every line class Reader < IOStreams::Reader # Read a line as an Array at a time from a stream. # Note: # - The supplied stream _must_ already be a line stream, or a stream that responds to :each - def self.stream(line_reader, original_file_name: nil, **args, &block) + def self.stream(line_reader, original_file_name: nil, **args) # Pass-through if already a row reader - return block.call(line_reader) if line_reader.is_a?(self.class) + return yield(line_reader) if line_reader.is_a?(self.class) yield new(line_reader, **args) end # When reading from a file also add the line reader stream