| Class | RFits::ColumnInformationList |
| In: |
lib/rfits/rfits.rb
|
| Parent: | Object |
A list of ColumnInformation objects representing the set of column definitions. Behaves much like an array.
| table | [R] | The table the columns belong to. |
Create a list of ColumnInformation from the specified table.
cil = ColumnInformationList.new(table)
Append a new column to the table. See ColumnInformationList#[]= for details on what "options" can look like.
cil << {:name => 'new_column_1', :format => 'A10'}
cil << [{:name => 'new_column_1', :format => 'A10'}, {:name => 'new_column_2', :format => 'I'}]
Insert a column into the ith position. "options" is a hash with two keys:
You can also insert multiple columns at the same time by passing an array of hashes of the format explained above.
cil[1] = {:name => 'new_column_1', :format => 'A10'}
cil[1] = [{:name => 'new_column_1', :format => 'A10'}, {:name => 'new_column_2', :format => 'I'}]