Sha256: eb7599114ee4e8a07b1cdd0f741ebe7e30381f2977f5c12a4ff3457f843978b6

Contents?: true

Size: 915 Bytes

Versions: 32

Compression:

Stored size: 915 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing <definedName> tag
  class DefinedName < OOXMLDocumentObject
    # @return [String] Ranges to which defined name refers
    attr_reader :range
    # @return [String] Name
    attr_reader :name
    # @return [String] Id of sheet
    attr_reader :local_sheet_id
    # @return [Symbol] Specifies whether defined name is hidden
    attr_reader :hidden

    # Parse Defined Name data
    # @param [Nokogiri::XML:Element] node with DefinedName data
    # @return [DefinedName] value of DefinedName
    def parse(node)
      @range = node.text
      node.attributes.each do |key, value|
        case key
        when 'name'
          @name = value.value.to_s
        when 'localSheetId'
          @local_sheet_id = value.value.to_i
        when 'hidden'
          @hidden = attribute_enabled?(value)
        end
      end
      self
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.37.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.36.1 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.36.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.35.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.34.2 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.34.1 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.34.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.33.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.32.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.31.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.30.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.29.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.28.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.27.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.26.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.25.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.24.0 lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
ooxml_parser-0.23.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.22.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb