instance method CSV::Row#header_row?

header_row? -> bool[permalink][rdoc]

ヘッダ行であれば真を返します。そうでなければ偽を返します。



require "csv"

header_row = CSV::Row.new(["header1", "header2"], [], true)
row = CSV::Row.new(["header1", "header2"], [1, 2])
header_row.header_row? # => true
row.header_row?        # => false