delete

delete(index_or_header) Instance Public methods Removes and returns the indicated column or row. In the default mixed mode indices refer to rows and everything else is assumed to be a column header. Use #by_col!() or #by_row!() to force the lookup.

delete_if

delete_if(&block) Instance Public methods Removes any column or row for which the block returns true. In the default mixed mode or row mode, iteration is the standard row major walking of rows. In column mode, interation will yield two element tuples containing the column name and an Array of values for that column. This method returns the table for chaining.

each

each(&block) Instance Public methods In the default mixed mode or row mode, iteration is the standard row major walking of rows. In column mode, interation will yield two element tuples containing the column name and an Array of values for that column. This method returns the table for chaining.

headers

headers() Instance Public methods Returns the headers for the first row of this table (assumed to match all other rows). An empty Array is returned for empty tables.

inspect

inspect() Instance Public methods Shows the mode and size of this table in a US-ASCII String.

push

push(*rows) Instance Public methods A shortcut for appending multiple rows. Equivalent to: rows.each { |row| self << row } This method returns the table for chaining.

to_a

to_a() Instance Public methods Returns the table as an Array of Arrays. Headers will be the first row, then all of the field rows will follow.

to_csv

to_csv(options = Hash.new) Instance Public methods Returns the table as a complete CSV String. Headers will be listed first, then all of the field rows. This method assumes you want the #headers, unless you explicitly pass :write_headers => false. to_s

to_s

to_s(options = Hash.new) Instance Public methods Alias for: to_csv

values_at

values_at(*indices_or_headers) Instance Public methods 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 each Array. You can force column or row mode using #by_col!() or #by_row!(). You cannot mix column and row access.