[ruby/csv] Enhanced RDoc for CSV::Table
(https://github.com/ruby/csv/pull/166) https://github.com/ruby/csv/commit/1d685aede3
This commit is contained in:
parent
a23ae56c4d
commit
347afd39a3
Notes:
git
2023-05-24 16:44:41 +00:00
@ -55,9 +55,3 @@ Raises an exception if parsing with the empty \String:
|
||||
# Raises ArgumentError (:col_sep must be 1 or more characters: "")
|
||||
CSV.parse("foo0\nbar1\nbaz2\n", col_sep: col_sep)
|
||||
|
||||
Raises an exception if the given value is not String-convertible:
|
||||
col_sep = BasicObject.new
|
||||
# Raises NoMethodError (undefined method `to_s' for #<BasicObject:>)
|
||||
CSV.generate(line, col_sep: col_sep)
|
||||
# Raises NoMethodError (undefined method `to_s' for #<BasicObject:>)
|
||||
CSV.parse(str, col_sep: col_sep)
|
||||
|
@ -89,12 +89,3 @@ if any of the following is true:
|
||||
* The stream is only available for output.
|
||||
|
||||
Obviously, discovery takes a little time. Set manually if speed is important. Also note that IO objects should be opened in binary mode on Windows if this feature will be used as the line-ending translation can cause problems with resetting the document position to where it was before the read ahead.
|
||||
|
||||
---
|
||||
|
||||
Raises an exception if the given value is not String-convertible:
|
||||
row_sep = BasicObject.new
|
||||
# Raises NoMethodError (undefined method `to_s' for #<BasicObject:>)
|
||||
CSV.generate(ary, row_sep: row_sep)
|
||||
# Raises NoMethodError (undefined method `to_s' for #<BasicObject:>)
|
||||
CSV.parse(str, row_sep: row_sep)
|
||||
|
@ -23,11 +23,3 @@ With two write converters (called in order):
|
||||
str # => "a,b,c\n"
|
||||
|
||||
See also {Write Converters}[#class-CSV-label-Write+Converters]
|
||||
|
||||
---
|
||||
|
||||
Raises an exception if the converter returns a value that is neither +nil+
|
||||
nor \String-convertible:
|
||||
bad_converter = proc {|field| BasicObject.new }
|
||||
# Raises NoMethodError (undefined method `is_a?' for #<BasicObject:>)
|
||||
CSV.generate_line(['a', 'b', 'c'], write_converters: bad_converter)
|
Loading…
x
Reference in New Issue
Block a user