Sha256: e684b1c233d9362b9bf3d83447a6992779d05ba2dafbbcc8ea66efb472fe963a

Contents?: true

Size: 935 Bytes

Versions: 9

Compression:

Stored size: 935 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing <location> tag
  class Location < OOXMLDocumentObject
    # @return [String] ref of location
    attr_reader :ref
    # @return [Integer] first header row
    attr_reader :first_header_row
    # @return [Integer] first data row
    attr_reader :first_data_row
    # @return [Integer] first data column
    attr_reader :first_data_column

    # Parse `<location>` tag
    # @param [Nokogiri::XML:Element] node with location data
    # @return [Location]
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'ref'
          @ref = value.value.to_s
        when 'firstHeaderRow'
          @first_header_row = value.value.to_i
        when 'firstDataRow'
          @first_data_row = value.value.to_i
        when 'firstDataCol'
          @first_data_column = value.value.to_i
        end
      end
      self
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ooxml_parser-0.38.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb
ooxml_parser-0.37.1 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb
ooxml_parser-0.37.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb
ooxml_parser-0.36.1 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb
ooxml_parser-0.36.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb
ooxml_parser-0.35.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb
ooxml_parser-0.34.2 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb
ooxml_parser-0.34.1 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb
ooxml_parser-0.34.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb