Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
CSV#headers
csv.headers → object
lib/csv.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/csv.rb, line 2106
def headers
if @writer
@writer.headers
else
parsed_headers = parser.headers
return parsed_headers if parsed_headers
raw_headers = @parser_options[:headers]
raw_headers = nil if raw_headers == false
raw_headers
end
end
Returns the value that determines whether headers are used; used for parsing; see Option headers:
Example
CSV.new('').headers # => nil