End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
CSV#headers
csv.headers → object
lib/csv.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/csv.rb, line 2105
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