diff options
author | Burdette Lamar <BurdetteLamar@Yahoo.com> | 2020-05-12 16:42:45 -0500 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-07-20 02:32:50 +0900 |
commit | 6ba1abd40c4610506a638246431660a32a9b1798 (patch) | |
tree | b680025fca57f8aa0e1cece9cb7568d53af91400 /doc/csv/force_quotes.rdoc | |
parent | 033514c62fef937dda904daa3b73b2b9750913f0 (diff) |
[ruby/csv] Enhanced Rdoc for CSV (#122)
https://github.com/ruby/csv/commit/cd670595d5
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3332
Diffstat (limited to 'doc/csv/force_quotes.rdoc')
-rw-r--r-- | doc/csv/force_quotes.rdoc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/csv/force_quotes.rdoc b/doc/csv/force_quotes.rdoc new file mode 100644 index 0000000000..11afd1a16c --- /dev/null +++ b/doc/csv/force_quotes.rdoc @@ -0,0 +1,17 @@ +====== Option +force_quotes+ + +Specifies the boolean that determines whether each output field is to be double-quoted. + +Default value: + CSV::DEFAULT_OPTIONS.fetch(:force_quotes) # => false + +For examples in this section: + ary = ['foo', 0, nil] + +Using the default, +false+: + str = CSV.generate_line(ary) + str # => "foo,0,\n" + +Using +true+: + str = CSV.generate_line(ary, force_quotes: true) + str # => "\"foo\",\"0\",\"\"\n" |