Skip to content

Instantly share code, notes, and snippets.

@aharpole
Created April 28, 2014 23:00
Show Gist options
  • Save aharpole/11386511 to your computer and use it in GitHub Desktop.
Save aharpole/11386511 to your computer and use it in GitHub Desktop.
headers method in CSV.rb in ruby/ruby trunk
#
# Returns the headers for the first row of this table (assumed to match all
# other rows). An empty Array is returned for empty tables.
#
def headers
if @table.empty?
Array.new
else
@table.first.headers
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment