Method: CSV::Table#by_col_or_row!

Defined in:
lib/csv/table.rb

#by_col_or_row!Object

:call-seq:

table.by_col_or_row! -> self

Sets the mode for self to mixed mode (see Mixed Mode); returns self:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true).by_col!
table.mode # => :col
table1 = table.by_col_or_row!
table.mode # => :col_or_row
table1.equal?(table) # => true # Returned self


295
296
297
298
299
# File 'lib/csv/table.rb', line 295

def by_col_or_row!
  @mode = :col_or_row

  self
end