lib/excelfile/table.rb in rubyfromexcel-0.0.10 vs lib/excelfile/table.rb in rubyfromexcel-0.0.13

- old
+ new

@@ -4,10 +4,11 @@ end class Table def self.reference_for(table_name,structured_reference,cell_making_the_reference = nil) + # puts "'#{table_name.downcase}' not found in #{tables.keys}" unless tables.include?(table_name.downcase) return ":ref" unless tables.include?(table_name.downcase) tables[table_name.downcase].reference_for(structured_reference,cell_making_the_reference) end def self.reference_for_local_reference(cell,structured_reference) @@ -25,11 +26,11 @@ end attr_reader :worksheet, :name, :reference, :column_name_array, :number_of_total_rows, :all, :data, :headers, :totals, :column_names def self.from_xml(worksheet,xml) - Table.new(worksheet,xml['name'],xml['ref'],xml.css('tableColumn').map {|c| c['name']}.to_a,xml['totalsRowCount']) + Table.new(worksheet,xml['displayName'],xml['ref'],xml.css('tableColumn').map {|c| c['name']}.to_a,xml['totalsRowCount']) end def initialize(worksheet,name,reference,column_name_array,number_of_total_rows) @worksheet = worksheet @name = name @@ -44,9 +45,10 @@ @column_names = {} column_name_array.each_with_index do |name,index| @column_names[name.strip.downcase] = index # column['id'].to_i end Table.add(self) + RubyFromExcel.debug(:tables,"#{worksheet.name}.#{name} -> Table #{reference.inspect},#{column_name_array.inspect},#{number_of_total_rows}") end def column(name) name = $1 if name.to_s =~ /^(\d+)\.0+$/ return :na unless column = column_names[name.to_s.downcase] \ No newline at end of file