Sha256: 3a53889ef1d0bf1a3d010dfae6f7a4439e76444fb6c3cbc5ecc8dbda20eaed87

Contents?: true

Size: 726 Bytes

Versions: 1

Compression:

Stored size: 726 Bytes

Contents

require_relative 'xlsx_row/xlsx_cell'
# Single Row of XLSX
module OoxmlParser
  class XlsxRow < OOXMLDocumentObject
    attr_accessor :cells, :height, :style, :hidden

    def initialize(cells = [])
      @cells = cells
    end

    def self.parse(row_node)
      row = XlsxRow.new
      row.height = row_node.attribute('ht').value if OOXMLDocumentObject.option_enabled?(row_node, 'customHeight') && row_node.attribute('ht')
      row.hidden = OOXMLDocumentObject.option_enabled?(row_node, 'hidden')
      row_node.xpath('xmlns:c').each { |cell_node| row.cells[Coordinates.parse_coordinates_from_string(cell_node.attribute('r').value.to_s).get_column_number.to_i - 1] = XlsxCell.parse(cell_node) }
      row
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ooxml_parser-0.1.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb