1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/csv] fix typo conveters => converters for CSV parsing docs (#196)

https://github.com/ruby/csv/commit/77ccf486fe
This commit is contained in:
Sampat Badhe 2020-12-26 02:47:32 +05:30 committed by Kenta Murata
parent cd2c726bc0
commit 677ccb927c

View file

@ -429,7 +429,7 @@ You can use multiple field converters in either of these ways:
===== Recipe: Specify Multiple Field Converters in Option +:converters+ ===== Recipe: Specify Multiple Field Converters in Option +:converters+
Apply multiple field converters by specifying them in option +:conveters+: Apply multiple field converters by specifying them in option +:converters+:
source = "Name,Value\nfoo,0\nbar,1.0\nbaz,2.0\n" source = "Name,Value\nfoo,0\nbar,1.0\nbaz,2.0\n"
parsed = CSV.parse(source, headers: true, converters: [:integer, :float]) parsed = CSV.parse(source, headers: true, converters: [:integer, :float])
parsed['Value'] # => [0, 1.0, 2.0] parsed['Value'] # => [0, 1.0, 2.0]
@ -498,7 +498,7 @@ You can use multiple header converters in either of these ways:
===== Recipe: Specify Multiple Header Converters in Option :header_converters ===== Recipe: Specify Multiple Header Converters in Option :header_converters
Apply multiple header converters by specifying them in option +:header_conveters+: Apply multiple header converters by specifying them in option +:header_converters+:
source = "Name,Value\nfoo,0\nbar,1.0\nbaz,2.0\n" source = "Name,Value\nfoo,0\nbar,1.0\nbaz,2.0\n"
parsed = CSV.parse(source, headers: true, header_converters: [:downcase, :symbol]) parsed = CSV.parse(source, headers: true, header_converters: [:downcase, :symbol])
parsed.headers # => [:name, :value] parsed.headers # => [:name, :value]