@@ -863,7 +863,10 @@ def filter(input=nil, output=nil, **options)
863863 # ["baz", "2"]
864864 #
865865 # Read rows from an \IO object:
866- # CSV.foreach(File.open(path)) {|row| p row } # => 21
866+ # File.open(path) do |file|
867+ # CSV.foreach(file) {|row| p row } # => 21
868+ # end
869+ #
867870 # Output:
868871 # ["foo", "0"]
869872 # ["bar", "1"]
@@ -1023,8 +1026,8 @@ def generate_line(row, **options)
10231026 # :call-seq:
10241027 # open(file_path, mode = "rb", **options ) -> new_csv
10251028 # open(io, mode = "rb", **options ) -> new_csv
1026- # open(file_path, mode = "rb", **options ) { |csv| ... } -> new_csv
1027- # open(io, mode = "rb", **options ) { |csv| ... } -> new_csv
1029+ # open(file_path, mode = "rb", **options ) { |csv| ... } -> object
1030+ # open(io, mode = "rb", **options ) { |csv| ... } -> object
10281031 #
10291032 # possible options elements:
10301033 # hash form:
@@ -1071,7 +1074,8 @@ def generate_line(row, **options)
10711074 #
10721075 # ---
10731076 #
1074- # With a block given, calls the block with the created \CSV object:
1077+ # With a block given, calls the block with the created \CSV object;
1078+ # returns the block's return value:
10751079 #
10761080 # Using a file path:
10771081 # csv = CSV.open(path) {|csv| p csv}
0 commit comments