The mixed mode default is to treat a list of indices as row access,
returning the rows indicated. Anything else is considered columnar access.
For columnar access, the return set has an Array
for each row with the values indicated
by the headers in eachArray. You
can force column or row mode using by_col!() or by_row!().
You cannot mix column and row access.
# File lib/csv.rb, line 765
def values_at(*indices_or_headers)
if @mode == :row or # by indices
( @mode == :col_or_row and indices_or_headers.all? do |index|
index.is_a?(Integer) or
( index.is_a?(Range) and
index.first.is_a?(Integer) and
index.last.is_a?(Integer) )
end )
@table.values_at(*indices_or_headers)
else # by headers
@table.map { |row| row.values_at(*indices_or_headers) }
end
end