summaryrefslogtreecommitdiff
path: root/doc/csv/options/generating/force_quotes.rdoc
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2020-06-24 16:04:25 -0500
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-20 02:32:53 +0900
commitd9eff306f5806c6a1b79019ec44395e4cc816218 (patch)
treeff5b302f3beba9a165b88d8b95aca8541296d34a /doc/csv/options/generating/force_quotes.rdoc
parent920a16893ad5b76bcb357d45f2c0b9d91d09268e (diff)
[ruby/csv] Organize files in doc/ (#145)
https://github.com/ruby/csv/commit/bc9ea859b0
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3332
Diffstat (limited to 'doc/csv/options/generating/force_quotes.rdoc')
-rw-r--r--doc/csv/options/generating/force_quotes.rdoc17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/csv/options/generating/force_quotes.rdoc b/doc/csv/options/generating/force_quotes.rdoc
new file mode 100644
index 0000000000..11afd1a16c
--- /dev/null
+++ b/doc/csv/options/generating/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"