Method: CSV::Table#by_col
- Defined in:
- lib/csv.rb
#by_col ⇒ Object
Returns a duplicate table object, in column mode. This is handy for chaining in a single call without changing the table mode, but be aware that this method can consume a fair amount of memory for bigger data sets.
This method returns the duplicate table for chaining. Don’t chain destructive methods (like []=()) this way though, since you are working with a duplicate.
603 604 605 |
# File 'lib/csv.rb', line 603 def by_col self.class.new(@table.dup).by_col! end |