summaryrefslogtreecommitdiff
path: root/lib/csv.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-05 13:33:21 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-05 13:33:21 +0000
commit60ebd4e26a1b6ed3ad11bade520db0a19e9be190 (patch)
tree7fd02799a27da1ab9c7f57ab5705100c4dab1d3b /lib/csv.rb
parent21ce539f20b1376ab4644f9620b0cd1487ae99d6 (diff)
Merge csv-3.0.0 from ruby/csv repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/csv.rb')
-rw-r--r--lib/csv.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/csv.rb b/lib/csv.rb
index ebb6d67968..dca2a45b6a 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -141,7 +141,7 @@ end
# There are several specialized class methods for one-statement reading or writing,
# described in the Specialized Methods section.
#
-# If a String passed into ::new, it is internally wrapped into a StringIO object.
+# If a String is passed into ::new, it is internally wrapped into a StringIO object.
#
# +options+ can be used for specifying the particular CSV flavor (column
# separators, row separators, value quoting and so on), and for data conversion,
@@ -890,8 +890,12 @@ class CSV
# attempt to parse input not conformant
# with RFC 4180, such as double quotes
# in unquoted fields.
- # <b><tt>:nil_value</tt></b>:: TODO: WRITE ME.
- # <b><tt>:empty_value</tt></b>:: TODO: WRITE ME.
+ # <b><tt>:nil_value</tt></b>:: When set an object, any values of an
+ # empty field are replaced by the set
+ # object, not nil.
+ # <b><tt>:empty_value</tt></b>:: When set an object, any values of a
+ # blank string field is replaced by
+ # the set object.
#
# See CSV::DEFAULT_OPTIONS for the default settings.
#
@@ -1232,7 +1236,7 @@ class CSV
elsif @unconverted_fields
return add_unconverted_fields(Array.new, Array.new)
elsif @use_headers
- return self.class::Row.new(Array.new, Array.new)
+ return self.class::Row.new(@headers, Array.new)
else
return Array.new
end