Sha256: 2293f82812af1ef2682978bd0af60d9816b6a750fcf7515d982a57b28405f7c2

Contents?: true

Size: 974 Bytes

Versions: 29

Compression:

Stored size: 974 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 [True, False] first header row
    attr_reader :first_header_row
    # @return [True, False] first data row
    attr_reader :first_data_row
    # @return [True, False] 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 = attribute_enabled?(value)
        when 'firstDataRow'
          @first_data_row = attribute_enabled?(value)
        when 'firstDataCol'
          @first_data_column = attribute_enabled?(value)
        end
      end
      self
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
ooxml_parser-0.14.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
ooxml_parser-0.14.1-mingw32 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
ooxml_parser-0.14.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
ooxml_parser-0.14.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
ooxml_parser-0.13.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
ooxml_parser-0.12.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
ooxml_parser-0.12.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
ooxml_parser-0.12.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
ooxml_parser-0.11.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb