lib/workbook/row.rb in workbook-0.5 vs lib/workbook/row.rb in workbook-0.6

- old
+ new

@@ -10,11 +10,11 @@ # Initialize a new row # # @param [Workbook::Row, Array<Workbook::Cell>, Array] cells list of cells to initialize the row with, default is empty # @param [Workbook::Table] table a row normally belongs to a table, reference it here - # @param [Hash] options Supprted options: parse_cells_on_batch_creation (parse cell values during row-initalization, default: false), cell_parse_options (default {}, see Workbook::Modules::TypeParser) + # @param [Hash] options Supported options: parse_cells_on_batch_creation (parse cell values during row-initalization, default: false), cell_parse_options (default {}, see Workbook::Modules::TypeParser) def initialize cells=[], table=nil, options={} options=options ? {:parse_cells_on_batch_creation=>false,:cell_parse_options=>{},:clone_cells=>false}.merge(options) : {} cells = [] if cells==nil self.table= table cells.each do |c| @@ -36,10 +36,10 @@ # Returns the table this row belongs to # # @return [Workbook::Table] the table this row belongs to def table - @table + @table if defined?(@table) end # Set reference to the table this row belongs to without adding the row to the table # # @param [Workbook::Table] t the table this row belongs to