@@ -863,7 +863,10 @@ def filter(input=nil, output=nil, **options)
863
863
# ["baz", "2"]
864
864
#
865
865
# 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
+ #
867
870
# Output:
868
871
# ["foo", "0"]
869
872
# ["bar", "1"]
@@ -1023,8 +1026,8 @@ def generate_line(row, **options)
1023
1026
# :call-seq:
1024
1027
# open(file_path, mode = "rb", **options ) -> new_csv
1025
1028
# 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
1028
1031
#
1029
1032
# possible options elements:
1030
1033
# hash form:
@@ -1071,7 +1074,8 @@ def generate_line(row, **options)
1071
1074
#
1072
1075
# ---
1073
1076
#
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:
1075
1079
#
1076
1080
# Using a file path:
1077
1081
# csv = CSV.open(path) {|csv| p csv}
0 commit comments